RE: INSERT Array Values into mySQL Table

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

 



> 
> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",", 
> array_keys($pr1)) .")
> 	  VALUES ('abc', '123', '456', ". implode(",", 
> array_values($pr1))
> .")";
> 
> HTH,
> 
> Brad


Might not work if the array values need to be enclosed in quotes.  I would
build the query string in a foreach loop and execute the query afterwards.

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