Danny620 Posted November 3, 2009 Share Posted November 3, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/180183-solved-high-counter/ Share on other sites More sharing options...
mikesta707 Posted November 3, 2009 Share Posted November 3, 2009 look into MySQL's MAX function http://www.w3schools.com/sql/sql_func_max.asp Quote Link to comment https://forums.phpfreaks.com/topic/180183-solved-high-counter/#findComment-950498 Share on other sites More sharing options...
Danny620 Posted November 3, 2009 Author Share Posted November 3, 2009 thank you very much thats help me nearly finsih my game Quote Link to comment https://forums.phpfreaks.com/topic/180183-solved-high-counter/#findComment-950501 Share on other sites More sharing options...
mikesta707 Posted November 3, 2009 Share Posted November 3, 2009 remember to click solved on the bottom of the thread if your topic is solved Quote Link to comment https://forums.phpfreaks.com/topic/180183-solved-high-counter/#findComment-950502 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.