Good day to you all experts!
I'm a novice in PHP and MySQL, I registerd here just few days ago, and I'm currently working on a web application using PHP and MYSQL. The web app works fine in my local computer. But when I've uploaded it on the webserver, I encountered an error saying that table does not exists. Here is the exact error. "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/rttsrc1/public_html/casechecklist/phpscripts/loginscript.php on line 18
Table 'rttsrc1_dbCaseCheckList.tblUsers' doesn't exist".
I've checked my database (rttsrc1_dbCaseCheckList) in PHP Admin under my cPanel and all my tables are there including the tblUsers.
Here are my codes.
===============================================
$mySqlServer = "localhost";
$ServerUserName = "rttsrc1";
$ServerPassword = "********";
$db = "rttsrc1_dbCaseCheckList";
$dbCon = mysql_connect($mySqlServer,$ServerUserName,$ServerPassword);
if (!$dbCon )
die('Could not connect to server. <br> Reason: ' . mysql_error());
//Selects a certain Database
mysql_select_db($db, $dbCon ) or die( "Unable to select database <br> Reason: ". mysql_error());
// Query from tables from the selected database
$rs = "SELECT * FROM tblUsers WHERE bActive=1";
$result = mysql_query($rs, $dbCon);// or die("Unable to select data because " . mysql_error());
//Get Record Count
$RecCount = mysql_num_rows($result) or die(mysql_error()); --> here is where the error occured..
===============================================
Is there something wrong in my codes? or the database settings? Please help me on this one.. Thank you in advance... great day ahead!
I'm a novice in PHP and MySQL, I registerd here just few days ago, and I'm currently working on a web application using PHP and MYSQL. The web app works fine in my local computer. But when I've uploaded it on the webserver, I encountered an error saying that table does not exists. Here is the exact error. "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/rttsrc1/public_html/casechecklist/phpscripts/loginscript.php on line 18
Table 'rttsrc1_dbCaseCheckList.tblUsers' doesn't exist".
I've checked my database (rttsrc1_dbCaseCheckList) in PHP Admin under my cPanel and all my tables are there including the tblUsers.
Here are my codes.
===============================================
$mySqlServer = "localhost";
$ServerUserName = "rttsrc1";
$ServerPassword = "********";
$db = "rttsrc1_dbCaseCheckList";
$dbCon = mysql_connect($mySqlServer,$ServerUserName,$ServerPassword);
if (!$dbCon )
die('Could not connect to server. <br> Reason: ' . mysql_error());
//Selects a certain Database
mysql_select_db($db, $dbCon ) or die( "Unable to select database <br> Reason: ". mysql_error());
// Query from tables from the selected database
$rs = "SELECT * FROM tblUsers WHERE bActive=1";
$result = mysql_query($rs, $dbCon);// or die("Unable to select data because " . mysql_error());
//Get Record Count
$RecCount = mysql_num_rows($result) or die(mysql_error()); --> here is where the error occured..
===============================================
Is there something wrong in my codes? or the database settings? Please help me on this one.. Thank you in advance... great day ahead!