PDA

View Full Version : New to php and mySQL



myclr23
11-06-2008, 07:56 PM
I'm not sure I understand the file structure within Bluehost. For example, I have a sample .php code that tries to upload a file to a mySQL database. I don't think I'm pointing to the database correctly. Here's part of the code I'm trying to work with:

<?php
$db = mysql_connect("localhost", "root","");
mysql_select_db("mybuddy",$db); //connects to our mybuddy database
//replace the above two string's with your database specific values


I saved the .htm and .php forms under the /public_html/ directory. Not sure where exactly the database location i,s even after checking phpMyAdmin.

Any help would be great. Thanks!

felgall
11-07-2008, 11:30 AM
You need your account name and an underscore added to the front of the username. So if your domain was example.com your account name would be the first 8 characters - examplec - and the username would be examplec_root

The same with the database name which would be examplec_mybuddy