Jump to content

WHERE clause


karimali831

Recommended Posts

Hi

 

I'm trying to select borderbg, bg1, bg2 in my query WHERE cupID = highest value-1 if that make sense?

 

$style = mysql_query("SELECT borderbg, bg1, bg2 FROM ".PREFIX."cup_baum WHERE cupID=''");

 

e.g. table:

 

cupID: (auto_increment)

 

78

77

76

75

...

 

$style selects borderbg, bg1, bg2 WHERE cupID=77 because it has the highest value-1 in the table. (or second highest)

 

Any help will be great

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/208864-where-clause/
Share on other sites

Are you sure? I was curious as to which method would be faster so I was going to do a test, and I received an "invalid use of group function" error. I also recall encountering a similar problem when attempting to use MAX() in a similar situation a while ago.

Link to comment
https://forums.phpfreaks.com/topic/208864-where-clause/#findComment-1091123
Share on other sites

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.