Avatar of phpretard
phpretard

asked on 

How can I select the highest number from a list of fields?

$result = mysql_query("SELECT * FROM 4Sale ");

while($row = mysql_fetch_array($result))
  {
  $highbid=$row['bid']; // THERE ARE SEVERAL DIFFERENT ENTRIES FOR BID
  }


// I am trying to validate with this

      if($bid < $highBid) {
      ECHO"BID HIGHER";
      }

of course the form field is name=bid AND THE db FIELD NAME IS BID.      
Web Development

Avatar of undefined
Last Comment
phpretard
Avatar of orcic
orcic

$result = mysql_query("SELECT max(bid) maxBid FROM 4Sale ");
Avatar of phpretard
phpretard

ASKER

$result = mysql_query("SELECT max(bid) maxBid FROM 4Sale  ");

while($row = mysql_fetch_array($result))
{
How do I show the highest number?
}
ASKER CERTIFIED SOLUTION
Avatar of orcic
orcic

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of phpretard
phpretard

ASKER

Got it!

Thank you!
Web Development
Web Development

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.

78K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo