Hi there,
I have a bit of strange question: when wanting to insert multiple records
into the db, instead of looping through the set and executing mysql_query
(which will then call the db n times), is it not better to concat a string
with all the insert statements and let mysql handle the
, if it was loop, you know exactly what went wrong by outputing the
current insert statement.
C.
-Original Message-
From: Thomas [mailto:[EMAIL PROTECTED]
Sent: 02 June 2005 10:20
To: php-general@lists.php.net
Subject: [PHP] Multiple inserts as a single string?
Hi there,
I have a bit of strange
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
T executing mysql_query (which will then call the db n times), is it
T not better to concat a string
Message-
From: Thomas [mailto:[EMAIL PROTECTED]
Sent: 02 June 2005 12:20
To: Shaw, Chris - Accenture
Cc: php-general@lists.php.net
Subject: RE: [PHP] Multiple inserts as a single string?
*
This e-mail has been received by the Revenue Internet e-mail service
Richard Davey wrote:
snip
Sure.. mysql_query doesn't support more than one query in the sql
statement.
snip
At the risk of being thick, does the OP not mean something like this:
INSERT INTO blah VALUES (value1, value2), (value3, value4)
versus
INSERT INTO blah
VALUES (value1, value2)
Message-
From: Shaw, Chris - Accenture [mailto:[EMAIL PROTECTED]
Sent: 02 June 2005 12:20 PM
To: Thomas; php-general@lists.php.net
Subject: RE: [PHP] Multiple inserts as a single string?
Thomas,
If you're inserting alot of rows, (eg millions) then concating them and
calling the db once
Thanks Richard that makes it clear.
Thomas
-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED]
Sent: 02 June 2005 12:43 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Multiple inserts as a single string?
Hello Thomas,
Thursday, June 2, 2005, 10:20:11 AM, you wrote
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
8 matches
Mail list logo