$krc = mysql_query("SELECT * from poller ORDER BY id DESC LIMIT 0,1"); while ($q = mysql_fetch_array($krc)) { $idas = $q['id']; } echo "$idas";