In my test script I just added an if conditional and can't seem to get out of the T_STRING vortex.
I just added the IF statement tonite. The update has been in place for a few months now and worked file. Putting it at the else has wreaked havoc apparently. Here's what I have. This is my testing utility that's why there's so many echos.
$code = substr($desc,-6,1);
echo "Code = $code <br>";
if ($code == 'B') {
$insertqty = "INSERT INTO qytorders
(cat_code, order_num, pid, price, sold_date, sold_code, quantity, order_id, email, discount)
VALUES ('$code','','$pid','$money','NOW()','QTY','$qty','$id','$email','$discount');
mysql_query ($insertqty);
echo '...Insert data into qytorders <br>';
}
else {
//The error message is on the following line:
// Parse error: syntax error, unexpected T_STRING
$update = "UPDATE ckd_labinv
SET status ='S',
sold_code = 'SLD', sold_date = NOW()
WHERE pid = '$pid'
and status = 'A'";
$result = mysql_query($update) or die (mysql_error());
}
$num_rows = mysql_affected_rows();//$result
echo "<br>Number of Rows: $num_rows<br>";
What did I miss here? Thanks.