Results 1 to 2 of 2

Thread: help Connecting to SQL with PHP
      
   

  1. #1
    Join Date
    Feb 2010
    Posts
    1

    Talking help Connecting to SQL with PHP

    I am trying to connect to a database I created using the C-panel. I have the script installed correctly becuse I get a error message that I wrote when I try to go to the home page that says cant connect to sql database. here is the code I have. Can you tell me what I have done wrong?

    <?php
    $db_host = "localhost";
    $db_username = "fepiiakh_Aaron";
    $db_pass = "Du2Ef^JBO.qv";
    $db_name = "fepiiakh_test";

    @mysql_connect("$localhost","$fepiiakh_Aaron","$Du 2Ef^JBO.qv") or die ("Aaron I could not connect to mysql");
    @mysql_select_db("$fepiiakh_test") or die ("no database");
    ?>

  2. #2
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: help Connecting to SQL with PHP

    <?php
    $db_host = "localhost";
    $db_user = "fepiiakh_Aaron";
    $db_pass = "Du2Ef^JBO.qv";
    $db_name = "fepiiakh_test";

    $conn = mysql_connect($db_host, $db_user, $db_pass) or die ("Aaron I could not connect to mysql");
    mysql_select_db($db_name, $conn) or die ("Could not select database");
    ?>
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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