Jump to content

php/MySQL insert for multiple records...


asevie

Recommended Posts

Fairly new to html, php etc. I can create rudimentary forms but now I'm trying to add multiple records at a time.

 

How do I make the following a variable?
 
I'd like to have this as my insert...
 
$sql = "INSERT INTO  `somedb` (  `ffid` ,  `email` ,  `sku`) VALUES (  $somenewvariable  )";
 
Where $somenewvariable equals this;
 
' ', 'email1@gmail.com', '408'),
(' ', '[email protected]', '400'),
(' ', '
[email protected]', '412'
 
 I'm missing something very basic, ie back slashes! The variable is turning into something like this;
 
\'\', \'[email protected]\', \'408\'), (\'\', \'[email protected]\', \'400\'
Link to comment
https://forums.phpfreaks.com/topic/276050-phpmysql-insert-for-multiple-records/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.