You're passing $insert but it should be $query in if (mysql_query($insert, $conn))