+ Reply to Thread
Results 1 to 2 of 2

Thread: New to php and mySQL

  1. #1
    Join Date
    Nov 2008
    Location
    VA
    Posts
    1

    Default New to php and mySQL

    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!

  2. #2
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    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

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts