<?php
$flowers = $_REQUEST['flowers'];
//подключение
$mysqli = new mysqli('localhost','doptvarh_nic','7L0z3B3g','doptvarh_bd123');
//ошибка
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$insert_sqli = "INSERT INTO anceta ([flowers]) VALUES('{$flowers}');";
mysqli_query($mysqli,$insert_sqli);
var_dump($mysqli);
?>
код скрипта
код ошибки(var_damp)
object(mysqli)#1 (19) { ["affected_rows"]=> int(-1) ["client_info"]=> string(75) "mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $" ["client_version"]=> int(50010) ["connect_errno"]=> int(0) ["connect_error"]=> NULL ["errno"]=> int(1064) ["error"]=> string(173) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[flowers]) VALUES('да')' at line 1" ["error_list"]=> array(1) { [0]=> array(3) { ["errno"]=> int(1064) ["sqlstate"]=> string(5) "42000" ["error"]=> string(173) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[flowers]) VALUES('да')' at line 1" } } ["field_count"]=> int(0) ["host_info"]=> string(25) "Localhost via UNIX socket" ["info"]=> NULL ["insert_id"]=> int(0) ["server_info"]=> string(21) "5.5.5-10.0.30-MariaDB" ["server_version"]=> int(50505) ["stat"]=> string(155) "Uptime: 2708014 Threads: 15 Questions: 868360153 Slow queries: 939 Opens: 5576274 Flush tables: 1 Open tables: 65533 Queries per second avg: 320.663" ["sqlstate"]=> string(5) "00000" ["protocol_version"]=> int(10) ["thread_id"]=> int(10341223) ["warning_count"]=> int(0) }