Jump to content

Recommended Posts

Hi Just wanted to know if php had a function that chosen the larges number

 

say i have a set of records like bids and i want php to be able to work out whos got the highest bid for example

 

i am user 1 and i place a bid of 1000 that gets stored into the db like so

 

id | 1 | bid | 1000

 

now say user 2 comes along and sees that user 1 has bidded 1000 so user 2 now would have to place a bit of a minium of 1500 to bet him so say he places a bet of 2000 that then gets stored into the db

 

like

id | 2 | bid | 2000

 

now i want a function that gets both results and the works out which number is largiest and then it stores that in a var

 

so i am thinking along these lines

 

the function gets highest bid put it in $highbid + 500 then i could use a if($bid >= $highbid){ then update db with higher bid; }

 

so can anyone help me out here thanks

Link to comment
https://forums.phpfreaks.com/topic/180183-solved-high-counter/
Share on other sites

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.