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 mysql_result() - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php