Re: max. value from select statement

2001-09-03 Thread Rodney Broom
From: Mike Yuen <[EMAIL PROTECTED]> > The query I have is: select max(mid) from mboard; > BUT I tried the following in PHP and it doesn't work: > > $myquery = "SELECT max(mid) FROM mboard"; > $myresult = mysql_query($myquery); > $row = mysql_fetch_object($myresult); > print "$row->mid is result

max. value from select statement

2001-09-03 Thread Mike Yuen
I have a table as such where mid is my auto increment primary key: TABLE: mboard mid 2 3 4 5 I'm doing this in combination with PHP4. What I want to do is build a query that will allow me to get the largest mid from the table (mboard) above. The query I have is: select max(mid) from mboard; BUT