|
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
Navigation:
[Reply to this message]
|