php - Check the manual that corresponds to your MySQL server version for the right syntax: Update does not trasmit the data in the db because of this error -
in error tells error near
'update 'item' set price='120' itemname ='cebu - manila airpla' @ line `2`
here php code adds entry database
$updateentry1 ="set sql_safe_updates=0; update 'item' set price='120' itemname ='cebu - manila airplane ticket';"; retrievetable($updateentry1);
here retrieve table function function stores info in db
function retrievetable($query){ $config = parse_ini_file('/config.ini'); $connect = mysqli_connect($config['servername'], $config['username'], $config['password'], $config['database']); $filter_result = mysqli_query($connect, $query)or die (mysqli_error($connect)); return $filter_result;}
three aspect
firts sure can use 2 sql statemnts in single query sql driver
$updateentry1 ="set sql_safe_updates=0;
second... price should number , not string
and third tablename without quote
update item set price=120 itemname ='cebu - manila airplane ticket';";
Comments
Post a Comment