$id = mysql_query("SELECT ID AS id FROM user where username='$user'"); $id = mysql_fetch_assoc($id); $id = $id["id"];