|
Posted by bobkaku on 09/20/05 07:12
Steve,
Thanks so much. Your solution works like a charm!
Steve wrote:
> > $query = "select max(qno) from answers";
> > $result = mysql_query($query);
>
> > $maxqno = mysql_result($result);
>
> > $nextqno = $result + 1;
>
> mysql_result() needs a minimum of two arguments: resource and row
> number.
>
> Alternatively, use an alias for the aggregate column and get it by
> name:
>
> $query = "select max(qno) as maxqno from answers";
> $result = mysql_query( $query );
>
> $row = mysql_fetch_array( $result, MYSQL_ASSOC );
> print $row[ 'maxqno' ];
>
> ---
> Steve
Navigation:
[Reply to this message]
|