Here is a slice from the php file of the form handler:

//--Отправка голосования в БД $title = $_REQUEST['Заголовок']; $desc = $_REQUEST['Описание']; $vis = $_REQUEST['Видимость']; $date = date('l jS \of FYH:i'); $query = " SET FOREIGN_KEY_CHECKS=0; INSERT INTO `Голосования` VALUES ( '$vote_id', '0', '$title', '$desc', '$type', '$date', '$vis', 'На рассмотрении', '0'); "; echo $query; $result = mysqli_query($link, $query) or die("<b>Ошибка:</b> " . mysqli_error($link)); mysqli_free_result($result); 

echo displays the entire query correctly, but mysqli_error still returns an error of the form:

 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `Голосования` VALUES ( '3', '0', 'Заголовок',' at line 3 

The request is correct (checked in the phpMyAdmin console on LAN), which means the error is due to the fact that part of the request simply does not reach. How to fix it?

  • Does the library support multi-queries? If yes - is it necessary to explicitly allow this in the settings? - Akina
  • mysqli_query on mysqli_multi_query and the error went away, thanks for the hint) - Daniel

0