This is the code i am working with:
<?php
//$result = mysql_query("SELECT * FROM zen_orders Where orders_id=".$_GET['order_id']);
$sql = "SELECT * FROM zen_orders_total Where orders_id=".$_GET['order_id'];
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result)
?>
<?php
$ot_shipping_amount=$row['class->ot_shipping'];
$ot_total_amount=$row['class->ot_total'];
//echo $ot_shipping_amount;
if ($ot_shipping_amount>0) {
echo "<a target='_blank' href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=some@mail.net&item_name=Online_Order&item_number=&amount=$ot_total_amount&no_shipping=2&no_note=1¤cy_code=USD&bn=PP-BuyNowBF&charset=UTF-8'>Please click here to Pay.</a>";
}else{
echo "Your shipment total has not been updated.";
}
?>
Here is a link to view the table i am working with.
http://onpointsys.com/table.jpg
What i am tryint to achieve:
I would like to SELECT a clause with two Where's. Example, one by order_id from the URL which i have already done and also by the class column which has a value of ot_shipping but must also query the data in the value column .
Then i am trying to create an if statement where if the ot_shipping value is greater than zero display the link if not echo the text above.
So at the end i am trying to get the following results.
order_id=1 and ot_shipping=144.2700 so that i can then place ot_shipping in a variable.
Any ideas?