hi i am writing a program which take the value from form and then execute a error "failed" each time. which means there is some error in my query but i cant find the problem. here is the code
<?php
session_start();
//print_r($_POST);
$name=$_SESSION['SESS_CUSTOMER_ID'];
$con=mysql_connect("localhost","root","");
mysql_select_db("pras2");
$product_id=$_POST['P_list'];
echo "$product_id";
$quantity=$_POST['quantity'];
$query= "INSERT INTO order (customer_ID, product_id, quantity) VALUES ('$name', '$product_id', '$quantity')";
//die($query);
$result=mysql_query($query);
if ($result)
{
echo " Your order has been passed to admin for acceptance/rejection";
}
else
{
echo " failed";
}
?>