Jump to content

Getting confused...mysql query with multiple requirements


perficut

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.