> 
> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to