Jump to content

Getting confused...mysql query with multiple requirements


Recommended Posts

I'd like to get all the records in my database that have the same Solicitation# which is also the propertyid in another database (hense the reference), and out of those records find out if the current user has submitted a bid. If so, i'd like to assign those bids to variables to be called on later in the page.

 

The dbase has the following fields

 

Solicitation  ContractorID    bid1    bid2    bid3

 

$sql2="SELECT * FROM ProcurementBids WHERE Solicitation='$propertyid' AND ContractorID='$contractor_id'" or die(mysql_error());  ;
$result=mysql_query($sql2);
$existingbid = ($result);

 

 

If the user has entered several bids for the same solicitation, How do I get to the record that has the lowest bid1 value?

 

I hope this makes sense.

thanks but I think my SELECT query gets what the same data. I just cant figure out how to now search those records for the one that has the lowest value in bid1, unless I can use the MIN in the SELECT query along with the other parameters. Didnt try that, but will. 

 

I thought there might be a for while loop to get that record.

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.