SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql error for zip code database script

    I've set this up probably 100 times, and I'm getting an error. I've checked my user name and settings and everything is correct. Please help?



    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'DB_HOST' (1) in /home/fcus/public_html/zipcode_table/code322_db.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 10
    Error! Could not connect to the database:
    Opportunity favors the prepared mind.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seems like you're using a constant named DB_HOST
    This constant is not defined. When php encounters an undefined constant, it assumes you meant a string litteral instead.

    Define your constant, or supply a proper string value(probably localhost)


Bookmarks

Posting Permissions

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