This is what Im doing:
$conn = db_connect();
$result = mysql_query("select customer_id from customers where username='$username'");( if (!$result)
return false;
$result = @mysql_fetch_array($result);
return $result;
(the username is the person who is logged in-and wants to make a purchase)
then i do this....
$result = mysql_query("insert into orders values
('', '$customer_id', '$total_price', '$date', 'PARTIAL')");
if (!$result)
return "Could not register you in database - please try again later.";
return true;
All of it goes in accept the customer_id which is always a zero. Im presuming it has somehting to do with username which its not recognising?? any ideas will be greatly appreciated. Thanks