1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP script problem

Discussion in 'Software Development' started by Boss Tweed, Dec 8, 2011.

Thread Status:
Not open for further replies.
  1. Boss Tweed

    Boss Tweed Thread Starter

    May 19, 2005
    PHP newbie here, trying to learn PHP $=& mySQL

    Get the following error when trying to login
    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host ' localhost' (1) in /home/jtecom/public_html/php/dbc.php on line 31
    Couldn't make connection.

    Here is the code Line 31 is in red.

    /*************** PHP LOGIN SCRIPT V 2.3*********************
    (c) Balakrishnan 2010. All Rights Reserved

    Usage: This script can be used FREE of charge for any commercial or personal projects. Enjoy!

    - This script cannot be sold.
    - This script should have copyright notice intact. Dont remove it please...
    - This script may not be provided for download except from its original site.

    For further usage, please contact me.

    /******************** MAIN SETTINGS - PHP LOGIN SCRIPT V2.1 **********************
    Please complete wherever marked xxxxxxxxx

    /************* MYSQL DATABASE SETTINGS *****************
    1. Specify Database name in $dbname
    2. MySQL host (localhost or remotehost)
    3. MySQL user name with ALL previleges assigned.
    4. MySQL password

    Note: If you use cpanel, the name will be like account_database

    define ("DB_HOST", "localhost"); // set database host
    define ("DB_USER", "jtecom_dave"); // set database user
    define ("DB_PASS",XXXXXX"); // set database password
    define ("DB_NAME","jte_clients.clients"); // set database name

    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection.");
    $db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database");

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Similar Threads - script problem
  1. n00e
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1030284

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice