Answer the question
In order to leave comments, you need to log in
PHP add rows to MySQL table?
The essence of the question is this, here is the code, and the table in mysql, when you click on the submit button, the page pretends to send (blinks) and then remains on the same page but with empty forms.
Answer the question
In order to leave comments, you need to log in
The table name must be quoted in the form ` (backtick), not '.INSERT INTO `vacancies` VALUES ...
Use prepared statements and bind param , you have mysqli, 2016 is in the yard.
Apostrophes were missing in the string with the mysql query when accessing the elements of the "$_POST" array. Also, it's better to pass NULL rather than an empty string as the value for the incremental id.
It should be something like this:
<?php
mysqli_query($CONNECT, "INSERT INTO 'vacancies' VALUES (NULL, '{$_POST['title']}', '{$_POST['wysiwig-area']}', NOW()");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question