PS> Here is my code...

PS> $query = "SELECT max(id) FROM bc_topic";
PS> $result = mysql_query($query);
PS> $temp = mysql_result($result, 0, "id");  <- this is line 8
PS> echo $temp[id];

PS> Here is the error I get ...

PS> Warning: id not found in MySQL result index 2 in /.../upload2.php on
PS> line 8

PS> What am I doing wrong here?

PS> I know for sure that there definately is a column named 'id' and it's
PS> the primary key and also an auto_increment.

You are not selecting id, you're selecting max(id).  If you do not use
 AS to make an alias, then you use max(id) as the third parameter of

- Julie

--> Julie Meloni

Find "Sams Teach Yourself MySQL in 24 Hours" at

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to