I have this accepted answer working well, where column 1 and column 2 are setup as varchar. When I insert a string into the form however it doesn't insert data into my database. I know that this is because I don't have quotation marks eg "value" around my string but I don't know how to handle this in php? Does anyone have any ideas here?
1 Answer
Erm... just type " around the values?
$sql2 .= '("' .$_POST['column1'][$i] . '", "' . $_POST['column2'][$i] . '")';
1 Comment
ak85
Yes that works thanks. I knew it would be something like that, I tried putting "" in other places around the $_POST['column1'][$i] but I couldn't quite get the syntax right. thanks!