Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Jenny Swift21,999 Points
working with a database on a real (not local) website
Hi, am familiar with working with a database on my computer using Mamp, but I am unsure how to work with a database on a real website. My understanding is Mamp is only local and can't be used for a real site? I am using webhostingforstudents.com as my host, and perhaps it has mysql because it can run wordpress, but I'm not sure how to work with it-how to query the database and view it like I can with phpmyadmin from Mamp. Can anyone please advise me in the right direction or point me to step by step instructions on how to do this? Does Treehouse cover this?
Couldn't really tell why your MySQl server is denying the mysqli_connect. I would recommend using PDO objects to use for connection to DB as it have feature to prohibit SQL injection. I would suggest to go through this course. Php with MysQL course in treehouse.
Edward Burton8,296 Points
Are you trying to connect to the database from your local environment as you develop or is the php file on the server? The reason I ask is that the error message you are getting almost looks like an error you would get if trying to connect to your database from a remote location. This won't work unless you specifically tell mysql you want to allow external connections.
Hope this helps.