PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Aug 15, 2020 5:23 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Oct 23, 2003 4:14 pm 
Offline
Forum Commoner

Joined: Mon Oct 07, 2002 8:55 am
Posts: 62
I am doing a little piece for an auction company. What i am trying to do is query a bid table and pull all the items for a particular auction facility out of the bid table so item #1 might have 20 entries which are 20 different bids. So I am doing a select distinct just to grab the items that have bids on them. now I want to loop through each item grabbing all the records (bid information) and trying to grab the starting bid and the final maximum bid on each item. Here what I have so far and I am stuck, can anyone help me with this? Thanks a lot.


$strSQL = "select distinct item from bidlog where auction='$auction' and code='B' order by item ";
$result = pg_exec($con, $strSQL);
if(!$result)
{
print("<SCRIPT>alert('An unknown error occurred. The bidder information could not be retrieved, please try again. If it does not work contact AMS.')</SCRIPT>\n");
return "false";
}

$bid_rows = pg_numrows($result);
for($z=0;$z<$bid_rows;$z++)
{
$data = pg_fetch_row($result, $z);
$strSQL = "select * from bidlog where auction='$auction' and code='K' and item='$data[0]' order by item ";
$result = pg_exec($con, $strSQL);
IN THIS AREA I THINK I NEED TO DO AN ARRAY AND DO A MIN($ARRAY) AND MAX($ARRAY) BUT NOT REALLY SURE THE BEST WAY

}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2003 1:54 am 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger


Top
 Profile  
 
 Post subject: ????
PostPosted: Fri Oct 24, 2003 2:17 am 
Offline
Forum Regular
User avatar

Joined: Mon Sep 29, 2003 2:26 am
Posts: 791
Location: Islamabad Pakistan


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 54 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group