Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 22-09-2009
Member
 
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.
Reply With Quote
  #2  
Old 22-09-2009
Member
 
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?
Reply With Quote
  #3  
Old 22-09-2009
Member
 
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 ........
Reply With Quote
  #4  
Old 22-09-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Insert Multiple Rows At Once in PHP"
Thread Thread Starter Forum Replies Last Post
How to auto insert rows in excel Yakov Windows Software 7 19-04-2012 05:55 PM
Help me transposing multiple rows into one column with row labeling in Excel RYAN$ MS Office Support 2 17-01-2012 06:31 PM
Multiple rows for same id on Oracle 10 KADIN Software Development 4 23-11-2009 05:20 PM
Multiple rows of tabs in Firefox Mr.ken Technology & Internet 3 25-04-2009 11:49 AM


All times are GMT +5.5. The time now is 12:26 AM.