@majedmahmood27

$time = date("Y-m-d H:i:s");//local varible that stores the date using the php function that format the date.

is this rigth explanation

right*

// insert statment to put into orders the values id that is in the session ,time dynamically retrieved from local varibale and subtotal from local variable

$userSQL =

"insert into

orders (userID, orderDateTime, orderTotal)

values (".$_SESSION['c_userID'].",'".$time."','".$subTotal."')";//userID that is in the session

$exeuserSQL=mysql_query($userSQL);

if(mysql_errno($conn) == 0)

{

//return the greatest order number... Meaning the largest number in the column and rename the column to max no

$orderCheck = "SELECT max(orderNo) as 'maxno' FROM orders

WHERE userID=".$_SESSION['c_userID'];

$exeorderCheck = mysql_query($orderCheck) or die(mysql_error());

$orderArray = mysql_fetch_array($exeorderCheck);

$latestorderNo=$orderArray['maxno'];// stores max number of order for this particular user and store in local variable.

echo "<p>Order has been placed successfuly";

echo "<b><p>ORDER NO: ".$latestorderNo."</b>";// dynamically retrieve the value from the local variable latestorderNo.

$SQL5="UPDATE orders SET orderTotal=".$total."

WHERE orderNo=".$latestorderNo; this is update sql statement that updates the orderTotal database column using the total local variable wherethe orderNo matches the orderNo of the current user who has just placed an order

$subTotal=$reququantity * $results3['prodPrice']; this is quantity retrieved from the for loop that times the array of records $result3 that references the prodPrice database column

echo "<label for='First_name' >First Name: </label>"; what does label for do

echo "<input type='text' name='U_fname' value=''><br>";//U_fname is the name of the textfield for First Name and is this right