HELP. Multi-Record Insert

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

Please Help!


Re: HELP. Multi-Record Insert wrote:
Quoted text here. Click to load it

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)

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


Re: HELP. Multi-Record Insert

INSERT INTO `graph_apps` (`app_id`,`name`) VALUES





One insert statement. Use commas. As I saw in a previous post, there is a  
30-second limit probably imposd on the server, and a 1MB query limit also  
probably imposed on the server. If its your own box, you can probably tweak  
that out.

Quoted text here. Click to load it

Re: HELP. Multi-Record Insert

The php timeout can be set with set_time_limit if the server is not  
running in secure mode. I didn't see a time limit on MySQL.

Jim Michaels wrote:
Quoted text here. Click to load it

Site Timeline