You are here: RE: [PHP] Multiple inserts as a single string? « PHP « IT news, forums, messages
RE: [PHP] Multiple inserts as a single string?

Posted by "Jared Williams" on 06/02/05 16:19

>
> Thanks Richard that makes it clear.
>
> Thomas
>
> Hello Thomas,
>
> Thursday, June 2, 2005, 10:20:11 AM, you wrote:
>
> T> I have a bit of strange question: when wanting to insert multiple
> T> records into the db, instead of looping through the set
> and executing
> T> mysql_query (which will then call the db n times), is it
> not better
> T> to concat a string with all the insert statements and let mysql
> T> handle the inserting, that way we don't call the db n
> times from php.
> T> Does that make any difference?

Inserting multiple rows with one INSERT statement is part of the SQL standard (IIRC), and MySQL supports it.

INSERT INTO table(a,b) VALUES (1,1), (2,2), (3,3), ... ,(n, n)


Jared

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация