I have the following code which echo the max id from my table challenge but its giving me this error :
Warning: mysql_result(): id not found in MySQL result index 6 in D:\xampp\htdocs\challenge.php on line 8
Here's my code:
<?php
require('config.php');
$result = mysql_query("SELECT max(id) FROM `challenge`");
$id = mysql_result($result, 0, 'id');
echo $id;
?>
My table challenge does have an id column then why PHP is not able to find.
I do have a correct connection to my database.