List:General Discussion« Previous MessageNext Message »
From:MySQL List Date:April 13 2003 5:49am
Subject:Re: MAX
View as plain text  
It looks like you messed up, you put this:

> using PHP. I have tried using MAX(id), but it isn't working. This is what
I


Then tried this code:
> $query = "SELECT MAX(idq) FROM question";

which is it: MAX(id) OR MAX(idq)?
did you accidentally hit the 'q' after id?

Richard.



----- Original Message -----
From: "C. Reeve" <creeve.2003@stripped>
To: "MySQL List" <mysql@stripped>
Sent: Sunday, April 13, 2003 1:22 PM
Subject: MAX


> I have a database with an ID field which I need to find the last number of
> using PHP. I have tried using MAX(id), but it isn't working. This is what
I
> have.
>
> $query = "SELECT MAX(idq) FROM question";
> $result = @mysql_query($query);
>
> $line = mysql_fetch_array($result);
>
> $count = $line['idq'];
>
>
> Is there something I am doing wrong here?
>
> TIA
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>
>

Thread
MAXC. Reeve12 Apr
  • RE: MAXDon Read12 Apr
  • Mysql 4.012 Doesn't show proper host in processlistJared Saul13 Apr
    • Re: Mysql 4.012 Doesn't show proper host in processlistStefan Hinz13 Apr
  • Re: MAXMySQL List13 Apr
  • Re: MAXPag13 Apr