$sql=mysql_query('SELECT MAX( id ) AS id FROM noticias '); $max=mysql_fetch_array($sql); echo $max['id'];