function findbidamountmax($strprod_id){
$fresult = mysql_query("SELECT prod_id, bid_status, MAX(bid_amount) FROM `tb_bids` WHERE bid_status = 'APPROVED' AND prod_id = '".$strprod_id."' GROUP BY prod_id") or die(mysql_error());
$fnum_rows = mysql_num_rows($fresult);
$frows = mysql_fetch_array($fresult);
$fbidamount = $frows['MAX(bid_amount)'];
if($fnum_rows<=0){
$fbidamount = 0;
}
return number_format($fbidamount,2);
}
function enum_select( $table , $field ){
$query = " SHOW COLUMNS FROM `$table` LIKE '$field' ";
$result = mysql_query( $query ) or die( 'error getting enum field ' . mysql_error() );
$row = mysql_fetch_array( $result , MYSQL_NUM );
#extract the values
#the values are enclosed in single quotes
#and separated by commas
$regex = "/'(.*?)'/";
preg_match_all( $regex , $row[1], $enum_array );
$enum_fields = $enum_array[1];
return( $enum_fields );
}
//-- select option and display --//
function selectoption( $name, $array_, $opt_string , $class="" , $width="", $index="", $multi=false, $size="")
{
if ($multi==true){$multiple="multiple";}else{$multiple="";}
echo '';
}
//-- checkbox checked & uncheck --//
function chkcheckedval($name, $arrayvalue, $chkarray , $js = "" )
{
echo ''.$arrayvalue;
echo $js.' />';
}
//-- radio checked & uncheck --//
function radcheckedval($name, $arrayvalue, $chkarray, $js = "" )
{
if($arrayvalue=="Yes"){
$arrayvalue = "Y";
} elseif( $arrayvalue=="No"){
$arrayvalue = "N";
}
echo ''.$arrayvalue;
}
//-- checkbox values merge --//
function chkboxvalues( $_chkstr , $sep ="-*-" )
{
if ( count( $_chkstr ) > 0 )
{ $_values = " ";
while( list( $key , $value ) = each( $_chkstr ) )
{
$_values .= trim( $value ).$sep;
}
}
return trim($_values);
}
function strseptoarray($str,$separator="-*-")
{
$token = strtok($str, $separator);
$i=0;
while ( $token !== false)
{
$i++;
$_array[$i] = $token;
$token = strtok($separator);
}
return $_array;
}
?>Access denied for user 'coeur'@'66.228.56.23' (using password: YES)