For some odd reason, when I add data to 2tables to my website through PHP, one column doesn't get updated in one particular table. Anyone have any clues as to why? Thanks...
Here is my code:
$qry = "INSERT INTO orders (orderid, order_status, customerid, date, ship_name, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_other)
VALUES ('$ses_cart_orderid', '1', '0', '0000-00-00', NULL, NULL, NULL, NULL, '0', NULL, NULL)";
$result = mysql_query($qry,$MYSQL_DBH);
$qry = "INSERT INTO order_items (orderid, productid, qty)
VALUES ('$ses_cart_orderid', '$additemid', '1') ";
$result = mysql_query($qry,$MYSQL_DBH);
The orderid for the first table (orders) is updated correctly, however in the second table (order_items), the orderid isn't put in but the rest of the information is correctly inputted. A zero is always put into the orderid column of the second table. Anyone know as to why this occurs? Thank you.