RE: db insert question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Im using mysql with PHP4, whats the best way to insert as many as 20 
> records at one time from a form?
> 
> Currently im just assigning each one a variable but that is messy and 
> takes ages, is their a way to loop over the array of form data then 
> maybe do the same to enter it into a database?
> 
> 
> Thanks for any help.

A generic question begs a generic answer:

foreach($formdata as $thisdata){
  $result=mysql_query("insert into ... values($thisdata) where ...");
}


Hope this helps, but it would be useful to have code examples, etc so that a
more relevant answer could be rendered.

JM
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux