Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

php/MySQL insert for multiple records...

$
0
0

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'),
(' ', 'email2@example.com', '400'),
(' ', '
email3@example.com', '412'
 
 I'm missing something very basic, ie back slashes! The variable is turning into something like this;
 
\'\', \'email1@gmail.com\', \'408\'), (\'\', \'email2@gmail.com\', \'400\'

Viewing all articles
Browse latest Browse all 13200

Trending Articles