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 'order (title, price, total_price, f_name, s_name, o_name, phone, adress, time, d' at line 1
Данная ошибка появилась при попытке вставить таблицы в базу.
<?
if($_SESSION['cart'] && isset($_POST['orders'])){
foreach($_POST as $ArrKey => $ArrKey)
{
$ArrKey = $_POST[$ArrKey];
}
//$date = date('Y-m-d');
//$time = date('H:i:s');
//$mysqli = db_connect();
foreach($_SESSION['cart'] as $id => $qty):
$product = find_product($id);
$query = mysql_query("INSERT INTO order (title, price, total_price, f_name, s_name, o_name, phone, adress, time, date, pr_id) VALUES ('{$product['title']}','{$product['price']}','{$product['total_price']}','$f_name','$s_name','$o_name','$phone','$adress','$time','$date','{$product['id']}')") or die (mysql_error());
endforeach;
}
?>