The problem is that your app[web page] doesn't create a successful database connection before passing you query statements to fetch data from the db:: //make sure you are using the correct user and password: //if you are using any Apache servers like xampp,wampp.. and you never supplied your password later on ,then the default credentials to connect to your db is:====> $host="localhost"; $user="root"; $password=""; $con = mysql_connect($host,$user,$password); if(!$con){ echo "SERVER CONNECTION FAILED : source =".mysql_error(); exit; //remember this avoid any further page processing... }