r/PHPhelp • u/[deleted] • Oct 13 '19
INSERT INTO sql table not working.
Am I inserting rows into my table correctly? This doesn't work for some reason.
$conn->exec("INSERT INTO Questions_Table (ID, Question, Votes) VALUES ($num_rows, $submitted_question, 1)");
9
Upvotes
6
u/akas84 Oct 13 '19
You are missing quotes in the string and you should check how to bind params or you will have and sql injection on there.