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";

I don't do any PHP, but I'm guessing that your return column name is something like 
'max(mid)'. Try this:

  $myquery = "SELECT max(mid) as max_mid FROM mboard";
  $myresult = mysql_query($myquery);
  $row = mysql_fetch_object($myresult);
  print "$row->max_mid is result";


---
Rodney Broom
Programmer: Desert.Net




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to