[PHP] Getting the highest number in a column

2002-10-15 Thread Phil Schwarzmann
Using PHP and a MySQL database, I want to grab the highest number in a particular column. Right now I have this VERY inefficient code to grab this number, there's got to be a better way. Does anyone have any ideas?? Thanks!

RE: [PHP] Getting the highest number in a column

2002-10-15 Thread Simon Taylor
select MAX(colname) from table; Cheers Simon -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 09:29 To: [EMAIL PROTECTED] Subject: [PHP] Getting the highest number in a column Using PHP and a MySQL database, I want to grab the highest number

RE: [PHP] Getting the highest number in a column

2002-10-15 Thread David Freeman
Using PHP and a MySQL database, I want to grab the highest number in a particular column. As is usual for questions like this, the answer is most likely that you should do it in your sql query. In this case, something like this would probably do it: SELECT MAX(some_column) FROM