OK so I read the archives on using MAX ID to query the highest auto_increment value.
Here is my code:
<?php
$DBhost = "host";
$DBuser = "user";
$DBpass = "pass";
$DBName = "name";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "SELECT last_insert_id() FROM webpage";
$result=mysql_query($sqlquery);
mysql_close();
echo "max id in table webpage is $result";
AND the output from this code is:
max id in table webpage is Resource id #2
I get the same result if I use:
"SELECT max(id) FROM webpage"
What is going on?
Thanks