Results 1 to 4 of 4

Thread: How to Insert Multiple Rows At Once in PHP

  1. #1
    Join Date
    Nov 2008
    Posts
    94

    How to Insert Multiple Rows At Once in PHP

    I have tried inserting multiple rows in database with the help of PHP I am using MySQL as my database but it give me an continues error list I have tried restarting my application, as it might kept any thing wrong in its cache but does not work out I have used simple inserting statment such as $sql = "INSERT INTO database (a,b,c,d,e) VALUES ('$a', '$b' ,'$c', '$d','$e')"; I am sure that there is absolutely no problem, but it does not working out. please help.

  2. #2
    Join Date
    Dec 2008
    Posts
    202

    Re: How to Insert Multiple Rows At Once in PHP

    If you want to insert multiple rows at once the standard procedure is to first select multiple rows and then use the "Insert" command. When it comes to inserting data the GridView has very little to offer. Using a technique as illustrated in my article titled Inserting a New Row in GridView you can insert a single record using EmptyDataTemplate of the GridView. However, what if you want to insert multiple rows using GridView?

  3. #3
    Join Date
    Apr 2008
    Posts
    88

    Re: How to Insert Multiple Rows At Once in PHP

    Try creating a function with a new recordset and call that function only when adding to the database, In real world cases developers often require such a mechanism. Orelse you may insert into t1 values(,,,) insert into t2 values(,,,) insert into t3 values(,,,,)......try this ........

  4. #4
    Join Date
    Apr 2008
    Posts
    193

    Re: How to Insert Multiple Rows At Once in PHP

    By design the GridView control is a data bound control. That means it always requires some data source to bind with. One more thing, does access treat this huge statement as a transaction ie. take it or leave it or does it execute until it encounters an error or until it finishes? It cannot be used in unbound fashion. In order to display empty rows in the GridView you need to have a data source that contains empty items.

Similar Threads

  1. How to auto insert rows in excel
    By Yakov in forum Windows Software
    Replies: 7
    Last Post: 19-04-2012, 05:55 PM
  2. Replies: 2
    Last Post: 17-01-2012, 06:31 PM
  3. Multiple rows for same id on Oracle 10
    By KADIN in forum Software Development
    Replies: 4
    Last Post: 23-11-2009, 05:20 PM
  4. Multiple rows of tabs in Firefox
    By Mr.ken in forum Technology & Internet
    Replies: 3
    Last Post: 25-04-2009, 11:49 AM

Tags for this Thread

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
  •  
Page generated in 1,751,823,477.72590 seconds with 16 queries