Results 1 to 2 of 2

Thread: PHP/MySql - Inserting Multiple Records

  1. #1
    Join Date
    Dec 2007
    Posts
    123
    Thanks
    17
    Thanked 1 Time in 1 Post

    Question PHP/MySql - Inserting Multiple Records

    I want to insert records into multiple tables at one go, I am doing this in the following way, is this the correct way of doing? If not, what is the better way?



    Code:
    mysql_query("insert into table1 values('abc')");
    mysql_query("insert into table2 values('ttt')");
    mysql_query("insert into table3 values('5t6')");
    mysql_query("insert into table4 values('ghy')");
    mysql_query("insert into table5 values('gfd')");


    Please help


    Thanx

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    that is the correct way. you need to use 1 insert statement per table

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •