August 17, 2007

Multiple INSERT’s in MySQL

You will find other articles relevant to this document in these sections:
Richard Lee @ 12:04 pm

Did you know you can actually do multiple record inserts in one mysql query? Well, since version 3.22.5 anyway… Just group each value set in parenthesis and seperate via commas - and bobs your uncle!

< ?php
 
$query = "INSERT INTO results (firstname, lastname, score) 
VALUES 
 ('joe', 'bloggs', 77),
 ('mary', 'jane', 80),
 ('matthew', 'heinze', 60)";
 
mysql_query($query);
 
?>
Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Furl
  • Reddit
  • YahooMyWeb

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment