gsc123
Programmer
- Jan 24, 2008
- 197
How easy is it to convert to PHP
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
function processSQLruns($valType){
switch ($valType):
case 1:
$sql = "SELECT TOP 1 bidhistory.bidAmount AS price FROM bidhistory WHERE (((bidhistory.idProduct)="&Session("pIdProduct")&") AND ((bidhistory.idCustomerBid) <> "&session("idcustomer")&")) ORDER BY bidhistory.bidAmount DESC ";
//assuming database already connected
$result = mysql_query($sql);
if(!$result):
echo "Error with query: $sql. error was " . mysql_error();
return false;
endif;
if (mysql_num_rows($result) == 0 ):
$pPriceMaxBidNotMine = 0;
else:
$rsMaxBid = mysql_fetch_object($result);
return $rsMaxBid->price;
//can also do this with mysql_fetch_assoc and use array notation: $rsMaxBid['price']
endif;
break;
default:
echo "do nothing";
endswitch;
}
$processSQLruns = processSQLruns($valType);
?>