PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include"conn.inc.php";
//SET ALL VARIABLES NEED TO STORE IN ORDER_TABLE--------------------------
$customerid = $_REQUEST['cid'];
$deliveryid = $_REQUEST['del'];
$sessid = $_REQUEST['sess'];
$today = date("d-m-Y");
//------------------------------------------------------------------------
//STORE ORDER AND GET ORDER NUMBER FROM ID
$insert_details = "INSERT INTO product_order (
order_date, customer_id)
VALUES (
'$today',
'$customerid')";
$insert_order = mysql_query($insert_details)
or (mysql_error());
//SET ORDER NUMBER
$orderid = mysql_insert_id();
//GET ORDER DETAILS FOR EACH ITEM ORDERED (order_qty and product_id)
$query = "SELECT * FROM carttemp WHERE carttemp_sess = '$sessid'";
$results = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($results)) {
extract($row);
$order_qty = $row['carttemp_quan'];
$productid = $row['carttemp_prodnum'];
//ADD EACH ITEM TO ORDER DETAILS TABLE------------------------------------
$insert4 = "INSERT INTO order_details (
order_num, order_date, order_qty, customer_id, product_id, del_id)
VALUES (
'$orderid',
'$today',
'$order_qty',
'$customerid',
'$productid',
'$deliveryid')";
$insert_details4 = mysql_query($insert4)
or (mysql_error());
}
?>
$insert_details4 = mysql_query($insert4)
or (mysql_error());
to
$insert_details4 = mysql_query($insert4)
or die(mysql_error());
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Is there more than one record to be retrieved?
Do each of the records have a unique fieldname? (such as a primary key)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.