Thread: MySQL Problem

Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    MySQL Problem

    Hi,

    I recently updated my /includes/functions/functions_prices.php file to enable MAP pricing. I replaced:
    return $final_display_price . $free_tag . $call_tag; (around line 296) to:

    //Map Pricing by SlickRicky Design : http://www.slickricky.com
    $database = mysql_connect('<DATABASE HOST>', '<DATABASE NAME>', '<DATABASE PASSWORD>')
    or die('Could not connect: ' . mysql_error());
    mysql_select_db('<DATABASE NAME>') or die('Could not select database');
    $query = sprintf("SELECT map_enabled FROM ".TABLE_PRODUCTS." where products_id = '" . $products_id . "'" . " limit 1");
    $result = mysql_query($query);
    $is_map_enabled = mysql_result($result, 0);

    if ($is_map_enabled == 1){
    return '<span class="map_pricing">'.MAP_PRICE_STORE_FRONT_TEXT.'</span>';
    } else {
    return $final_display_price . $free_tag . $call_tag;
    }
    //End Edit SlickRicky Design : http://www.slickricky.com

    I entered mysql.shop.thebricktongroup.com as my db host and I entered the name of my db "store" and the correct password.

    Now when I try to access my site I get the following error:

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host '<mysql.shop.thebricktongroup.com>' (1) in /home/.frowsy/bgroup01/shop.thebricktongroup.com/includes/functions/functions_prices.php on line 282
    Could not connect:

    Any ideas would be greatly appreciated.

    Nate

  2. #2
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: MySQL Problem

    Does that db host name match what is in your config files?

    all of mine have localhost listed there.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  3. #3
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default Re: MySQL Problem

    Which config files are you referring to? i.e. where are they located.

    I tired changing db name in the function_prices.php file to localhost, but to no avail.

    Thanks though,

    Nate

  4. #4
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: MySQL Problem

    admin/includes/configure.php
    includes/configure.php

    These are the config files that were set up when you installed the cart. If your cart worked before then the files have the correct path to the Database list in them
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  5. #5
    Join Date
    Aug 2006
    Posts
    197
    Plugin Contributions
    1

    Default Re: MySQL Problem

    I figured it out. I had some <>'s where I shouldn't have had them in the function_prices.php file.

    Thanks,

    Nate

 

 

Similar Threads

  1. MySQL Database problem
    By lordtoby in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 22 Aug 2010, 11:27 PM
  2. MySQL v5.1.41 admin problem
    By peanut77 in forum General Questions
    Replies: 14
    Last Post: 26 Nov 2009, 04:50 PM
  3. MySQL migrate problem
    By visua in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 25 Mar 2009, 10:35 AM
  4. mysql.sock problem
    By lbooth in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 15 Nov 2007, 05:52 PM

Posting Permissions

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