У меня появляется сообщение об ошибке со следующим кодом, который я использовал.Я получаю сообщение об ошибке:
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 values (34 1,1,250,2011-11-09,jahed)' at line 1
код, который я предоставил вам ниже, начинается со строки 1!
<?php
session_start();
?>
<?php
if(!isset($_SESSION["username"]))
{
header("Location: shoppinglogin.php");
}
?>
<?
include("includes/db.php");
include("includes/functions.php");
if($_REQUEST['command']=='update'){
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$address=$_REQUEST['address'];
$phone=$_REQUEST['phone'];
$result=mysql_query("insert into customers values('','$name','$email','$address','$phone')");
$max=count($_SESSION['cart']);
for($i=0;$i<$max;$i++){
$orderid=mysql_insert_id();
$pid=$_SESSION['cart'][$i]['productid'];
$q=$_SESSION['cart'][$i]['qty'];
$price=get_price($pid);
$date=date('Y-m-d');
$user=$_SESSION['username'];
mysql_query("insert into order values ('$orderid','$pid','$q','$price','$date','$user')")
or die(mysql_error());
}
die('Thank You! your order has been placed!');
session_unset();
}
?>
Спасибо за любую помощь:)