1

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 1

3

Erm... just type " around the values?

 $sql2 .= '("' .$_POST['column1'][$i] . '", "' . $_POST['column2'][$i] . '")'; 
Sign up to request clarification or add additional context in comments.

1 Comment

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.