I was trying to connect to my database through PHP but I keep getting the error:Warning: mysql_fetch_array() expects parameter 1 to be resourceI do not know what the problem is?This is the code I have:<?php  //Connect to the server  $connect = mysql_connect(localhost,root,);  //Connect to the database  mysql_select_db(firstdatab);  $query = mysql_query(SELECT * FROM users WHERE FavNumber = '44' );  //Get Results  $rows = mysql_fetch_array($query);  $first_name = $rows['Name'];  echo $first_name;?>Can someone tell me what is wrong?
Warning: mysql_fetch_array() expects parameter 1 to be resource
php;mysql;phpmyadmin;sql
Everything in your code looks fine so your problem lies elsewhere. You need to use mysql_error() to tell you what you problem is.<?php//Connect to the server$connect = mysql_connect(localhost,root,);//Connect to the databasemysql_select_db(firstdatab);$results = mysql_query(SELECT * FROM users WHERE FavNumber = '44' );if ($results){    $rows = mysql_fetch_array($results);    $first_name = $rows['Name'];    echo $first_name;}else{    echo mysql_error();}?>