Reply to Re: HELP. Multi-Record Insert

Your name:

Reply:


Posted by J.O. Aho on 12/08/05 11:08

Fuzzy.wonderdog@gmail.com wrote:
> Hello,
>
> I hope some one can help me, at least give me a little direction.
>
> I have the need to insert many records into the same table at once.
> Not very many data points (<5), but many (30+) records. Not being a
> PHP guru, I am at a loss as where to start. Really I am a PHP
> neophyte. Though I am a quick study and REALLY need to know how to do
> this.

Make one insert for each SQL line you want to insert, this way you can track
what went wrong if something would go wrong.

Of course you can use the ; to make a really long SQL statement, but you will
_NOT_ be able to find out what went wrong if something goes wrong.
INSERT INTO table(user,age) VALUE('tom','10'); INSERT INTO table(user,age)
VALUE('ann','11')

If you do not know how to use sql from PHP, then you should take a look at the
following page (assuming you are using mysql):
http://www.php.net/manual/en/ref.mysql.php


//Aho

[Back to original 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

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