I am trying to put this into the database. And i am getting an unexpected error, however, saying Column count doesn't match value count at row 1. What is wrong with the query?
<?php
if($_REQUEST['command']=='update'){
$charge = $_REQUEST['ocharge'];
$fname = $_REQUEST['ofname'];
$lname = $_REQUEST['olname'];
$mobile = $_REQUEST['omobile'];
$add1 = $_REQUEST['oadd1'];
$add2 = $_REQUEST['oadd2'];
$postcode = $_REQUEST['opostcode'];
$state = $_REQUEST['ostate'];
$country = $_REQUEST['ocountry'];
$weight = $_REQUEST['oweight'];
$credit = $_REQUEST['ocredit'];
$pin = $_REQUEST['opin'];
$city = $_REQUEST['ocity'];
$date=date('Y-m-d');
$time=time('H:i:s');
$result=mysql_query("insert into order values ('$date','$time','$charge','$fname','$lname','$mobile','$add1','$add2','$postcode','$state','$country','$weight','$credit','$pin','$city')");
$orderid=mysql_insert_id();
$max=count($_SESSION['cart']);
for($i=0;$i<$max;$i++){
$pid=$_SESSION['cart'][$i]['productid'];
$q=$_SESSION['cart'][$i]['qty'];
$price=get_price($pid);
$result1=mysql_query("insert into order_detail values ('$orderid','$pid','$q','$price')");
if($result1 === FALSE)
{
die("Query Failed!".mysql_error().$result1);
}
}
die('Thank You! your order has been placed!');
}
?>