Part of the EllisLab Network
   
 
My SQL Connection
Posted: 04 July 2009 05:10 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  44
Joined  05-28-2009

Hi all,

How do i check that my code is able to connect to MySql database?

Thanks
sirfAK

Profile
 
 
Posted: 04 July 2009 05:48 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  89
Joined  08-21-2007

Hi - have you tried running a simple query?? If not, try it and let us know your result.

 Signature 

ATOMIC Web Hosting - Quality Shared & Reseller Web Hosting

Profile
 
 
Posted: 04 July 2009 06:59 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  03-19-2008

Insert your database details, if it doesn’t connect you will get a message saying ‘Database Connection Error’

Profile
 
 
Posted: 05 July 2009 02:59 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  412
Joined  05-30-2008

Make sure you’re loading the database as well. I always have it set to autoload in autoload.php I think it is.

Profile
 
 
Posted: 06 July 2009 05:31 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  242
Joined  02-06-2009

If you can connect to the database in phpMyAdmin then the code can connect using the same credentials smile

 Signature 

Changing the world one line of code at a time

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120272 Total Logged-in Users: 27
Total Topics: 126399 Total Anonymous Users: 4
Total Replies: 664733 Total Guests: 327
Total Posts: 791132    
Members ( View Memberlist )