icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » What's wronge with my database??!!!

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old February 16th, 2006, 4:56 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Meesho's Avatar
 
Joined in Feb 2006
Lives in Saudi Arabia
15 posts
Gave thanks: 0
Thanked 0 times
Exclamation What's wronge with my database??!!!

Hi ..
I dont why my db does that with me ..
see this page plz:
http://www.ninehours.com/tutorials/4/
and i dont know how to contact with hosting support ..

pleeeeeease help me .. i gave up

Thanx in advance ..
Meesho is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 16th, 2006, 6:37 PM   #2 (permalink)
All Ur Base R Belong 2 Us
Excelling Contributor
 
Joined in Feb 2005
Lives in Vegas & New York
830 posts
Gave thanks: 2
Thanked 7 times
Re: What's wronge with my database??!!!

Modify the script

This line:
mysql_select_db("$dbname") or die( "Unable to select database.");

Change it to:
mysql_select_db("$dbname") or die( mysql_error() );

P.S.

Have you made sure that you already granted the user privileges for the database? Sometimes people create the database, create the user, but forget to grant the user privileges to the database. This might very well be it.

In any case, just modify the php line to what I gave you and when you run the script it will give you a specific reason why it couldn't connect to the database.
__________________
Nobody doing nothing
mr_fern is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 16th, 2006, 8:48 PM   #3 (permalink)
Registered User
Fresh Surpasser
 
Meesho's Avatar
 
Joined in Feb 2006
Lives in Saudi Arabia
15 posts
Gave thanks: 0
Thanked 0 times
Re: What's wronge with my database??!!!

Hi mr_fern
i changed it .. what will happen?!
Meesho is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 16th, 2006, 11:57 PM   #4 (permalink)
Web Designer
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7, Pass 78
14,153 posts
Gave thanks: 68
Thanked 53 times
Send a message via Skype™ to David
Re: What's wronge with my database??!!!

Quote:
Originally Posted by mr_fern
Modify the script

This line:
mysql_select_db("$dbname") or die( "Unable to select database.");

Change it to:
mysql_select_db("$dbname") or die( mysql_error() );

P.S.

Have you made sure that you already granted the user privileges for the database? Sometimes people create the database, create the user, but forget to grant the user privileges to the database. This might very well be it.

In any case, just modify the php line to what I gave you and when you run the script it will give you a specific reason why it couldn't connect to the database.
From a screenshot I saw, his user has them all, but it's still not connecting. I installed it fine on mine, but it's not working on his for some reason. I thought about the modification, but since it's in that variable format, it seems it should have worked anyway.
__________________
I'm a web designer that founded the company Asheboro Creative. You can follow me on Twitter, add me on Myspace, or read my articles on Asheboro Tech.
David is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 17th, 2006, 1:02 AM   #5 (permalink)
All Ur Base R Belong 2 Us
Excelling Contributor
 
Joined in Feb 2005
Lives in Vegas & New York
830 posts
Gave thanks: 2
Thanked 7 times
Re: What's wronge with my database??!!!

Quote:
Originally Posted by Meesho
Hi mr_fern
i changed it .. what will happen?!
mysql_error() returns a string which specifies the last error occured in mysql on a script

for example, if you had:

mysql_query("SELECT * FROM table_doesnt_exist") or die ( mysql_error() );

The script will die when it tries to execute the query and print to the screen that the table doesn't exist.
__________________
Nobody doing nothing
mr_fern is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 17th, 2006, 2:50 AM   #6 (permalink)
Registered User
Fresh Surpasser
 
Meesho's Avatar
 
Joined in Feb 2006
Lives in Saudi Arabia
15 posts
Gave thanks: 0
Thanked 0 times
Re: What's wronge with my database??!!!

Hi David .. Thanks! really i appercaite what u do 4 me ..


aha Mr.Fern.. i got it .. but i think the error doesnt clear .. i'm gonna die ..
__________________
.. My Blog ..
Meesho is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 17th, 2006, 3:10 PM   #7 (permalink)
The Mommy Slayer
Seasoned Poster
 
BigDaddy's Avatar
 
Joined in Mar 2005
Lives in Pinellas, FL
Hosted on Benz
83 posts
Gave thanks: 0
Thanked 0 times
Re: What's wronge with my database??!!!

I think what Mr Fern is saying (correct me if I'm wrong Fern) is that it will let you know why it is failing not to fix the issue.
__________________
"Your heart will always make itself known through your words."

http://www.codedfuture.com
A not-for-profit bringing the world to needy kids and families.
See how you can help.
BigDaddy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 17th, 2006, 3:15 PM   #8 (permalink)
All Ur Base R Belong 2 Us
Excelling Contributor
 
Joined in Feb 2005
Lives in Vegas & New York
830 posts
Gave thanks: 2
Thanked 7 times
Re: What's wronge with my database??!!!

That's exactly what I'm saying. He can find out the reason it can't select the database instead of a generic message.
__________________
Nobody doing nothing
mr_fern is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 18th, 2006, 12:55 AM   #9 (permalink)
Registered User
Fresh Surpasser
 
Meesho's Avatar
 
Joined in Feb 2006
Lives in Saudi Arabia
15 posts
Gave thanks: 0
Thanked 0 times
Re: What's wronge with my database??!!!

BigDaddy
mr_fern

guyz i would let u know something .. i'm arabian gurl .. and i dont understand very well ..
and i know the database problem not from me .. from SURPASS .. so to put a topic here .. the only solution that i've .. so plz guyz excuse me .. and explain in easy way .. believe i try the best to understand and eolve the problem ..
now i'm completely unaware what the problem is ..
thanks ..
__________________
.. My Blog ..
Meesho is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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