richiami il metodo setQuery() da un oggetto database mai creato... ti ripeto: se non sai ciò che fai non modificare nulla.

Codice PHP:
$host="localhost";
$user="xxxxxx";
$password="xxxx";
$name="xxxxxx";

$conn mysql_connect($host$user$password) or die("connesione non riuscita");
$db=mysql_select_db($name) or die("Impossibile selezionare db");

$query "SELECT MAX(id) AS last_id FROM tabella";
$result mysql_query($query);
while(
$row mysql_fetch_array($result)){
echo 
$row['last_id'];