x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
x10Hosting Member

Join Date: Jun 2008
Posts: 2
Credits: 242
rttsrc1 is on a distinguished road
Quote  
07-02-2008, 04:14 AM
Table does not exists

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,$Server Password);
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!
Reply With Quote
rttsrc1 is offlineReport Post
x10 Sophmore

Join Date: Apr 2008
Posts: 130
Credits: 881
phpasks will become famous soon enough
Quote  
07-02-2008, 08:14 AM
Re: Table does not exists

PHP Code:
<?php
$mySqlServer 
"localhost";
$ServerUserName "rttsrc1";
$ServerPassword "********";
$db "rttsrc1_dbCaseCheckList";

$dbCon 
$dbCon //mysql_connect($mySqlServer,$ServerUserName,$Server Password); $Server Password ==> your problem here.
mysql_connect($mySqlServer,$ServerUserName,$ServerPassword);
if (!
$dbCon )

?>
Your password variable set right then solved your problem.
__________________
Asif Khalyani
http://www.phpasks.com
Reply With Quote
phpasks is offlineReport Post
x10Hosting Member

Join Date: Jun 2008
Posts: 2
Credits: 242
rttsrc1 is on a distinguished road
Quote  
07-06-2008, 05:00 AM
Re: Table does not exists

Thank you for the response. Although I've encountered another error whenever the app connects to database. it is something like this...

================================================== ======
"Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'rttsrc1_marcn'@'74.86.133.24' (using password: YES) in /home/rttsrc1/public_html/sample.php on line 8
Could not connect to server.
Reason: Access denied for user 'rttsrc1_marcn'@'74.86.133.24' (using password: YES)".
================================================== ======
I'm suspecting my database username and password. Please help me how to know the correct username and password to access my database via PHP. Thank you and best regards..
Reply With Quote
rttsrc1 is offlineReport Post
Scripts and Computers Mod

Join Date: Apr 2006
Posts: 560
Credits: 3,283
Nathan H is on a distinguished road
Quote  
07-06-2008, 10:44 AM
Re: Table does not exists

If this is the only time that useraccoun is used, you can log into your cpanel, scroll down to go to MySQL databses and at the bottom of the page is user accounts management. I'm unsure of how to change passwords but you might consider making a new accouht in here and assiging it to your DB
__________________
Nathan H Formerly UnFoundBug



http://www.theadmin.co.uk - Yes i know the colours don't go, I'm working on it.

VPS Admin | x10-commandments
These results are to be used as a GUIDE ONLY


So thats where it went! I thought i was losing my mind.
Reply With Quote
Nathan H is offlineReport Post
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling IP addresses in your firewall. 1337scape Free Hosting 32 11-15-2007 01:40 PM
INSERT command denied?? 1337scape Free Hosting 6 11-14-2007 05:15 PM
[IPB] Contiguous Board Index phenetic Tutorials 5 09-18-2005 10:31 AM
Table inside table wizeman Tutorials 4 07-11-2005 05:56 PM


All times are GMT -5. The time now is 11:35 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

High Paying Adsense List | Loans | Free Ringtones | Hummer Dealership | Remortgages