mysql_connect("urdatabase","xxx","pass");
//select which database you want to connect
mysql_select_db("urdatabase");
$result = mysql_query("select
Replace(Price, '$', '') as Price from urproductstable;");;
// i like always having numrows available even though I'm not using it here
$num_rows = mysql_num_rows($result);
while($r=mysql_fetch_array($result))
{
//skip the rest of the xml attributes to get directly to the shipping cost code
if ( $r["Price"] <= 24.99 ) { $shippingcost = "3.95"; } elseif ( $r["Price"] >= 25 and $r["Price"] <= 49.99 ){ $shippingcost = "4.95"; } elseif ( $r["Price"] >= 50 and $r["Price"] <= 74.99 ){ $shippingcost = "5.95"; } elseif ( $r["Price"] >= 75 and $r["Price"] <= 99.99 ){ $shippingcost = "6.95"; } echo '
';}
No comments:
Post a Comment