PLS HELP! Having trouble with config.php

by Val10
13 replies
I truly need help with this config.php file. Been trying to figure it out for days now but no luck and no tutorial online to give some insight on what I should do.

I have some PHP knowledge and HTML knowledge but need some guidance in mysql.

Below is the section on the config.php I'm having trouble with...the trouble area is in red

$dbhost = 'mysql'; // database host
(is username and password for myphpadmin?)
$dbuser = 'whisper@localhost'; // database user name
$dbpass = '*******'; // database user password

$dbdatabase = 'ecards'; // database with Cards tables

To give you an idea of what I've done so far, I installed MyPHPAdmin in the actual file folder like this...

FTP folder funcards to my webhost

(inside this folder is)

Folder images
Folder admin
Folder css
Folder myphpadmin (i installed myphpadmin in this folder - database ecards was created in this folder with myphpadmin)

( no fields or tables yet - setup.php is suppose to create them )

So my dilemma is I'm not sure how to link/code ecards database in $dbdatabase.

I did noticed when I installed myphpadmin it stated location was- - root>ecards. Not sure if this means anything but added it just in case.

To give an idea of what setup.php does when I run it, I get this:

Could not connect to the selected database: ecards. Check the config.php file to be sure you set the correct database server, database name, username, and password. Contact your system administrator if you do not know these values.

Just in case...I did contact server host for the information on mysql.
my website is with yahoo
my host is suppose to be 'mysql'

Any guidance or solution would greatly be appreciated!

If you need additional info feel free to ask here.

xxxx

Valeen
#configphp #pls #trouble
  • Profile picture of the author Val10
    UPDATE:
    This is a free third party ecard script. It has a config.php and once configured it goes to a setup.php to set up tables. The entire folder has been FTP on my webhost.
    {{ DiscussionBoard.errors[1655641].message }}
  • Profile picture of the author mywebwork
    Hi Valeen

    Are you sure about the following values:

    = 'mysql'; // database host
    (is username and password for myphpadmin?)
    = 'whisper@localhost'; // database user name
    The dbhost value usually is either a URL, an IP address or will be "localhost" if the database resides on the same server as the web host.

    And the dbuser value usually isn't an e-mail address (but it could be).

    I would double-check these values. Let me know if I can be of assistance.

    Bill
    {{ DiscussionBoard.errors[1655733].message }}
  • Profile picture of the author weaverIT
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[1656489].message }}
    • Profile picture of the author Val10
      Many thanks weaverIT and mywebwork for your 'time' and 'quick' responses. xxx

      To assist you both in hopes to provide additional guidance to my dilemma I placed the entire config.php file in this post for you both (or anyone else ) to review when you get a moment.

      <?
      /

      /*
      *********************************************
      * eCard Application Info *
      *********************************************
      */

      $sitePath = ""; // needed to create url for eCard pickup. Please leave off trailing slash. (this url has not been created. had to remove sitepath html page to be able to post)
      $siteName = "Send an Ecard to a Friend"; // name shown in upper left corner of site and in emails
      $siteEmail = "ecards@mywebsite.com"; // 'From' email address shown in notification email (this email has been created)
      $deleteDays = 30; // Delete sent cards after this number of days. Set to 0 to not delete cards
      $showLoginLink = 'yes'; // Whether or not to show the 'login' link in the upper right. Valid options are 'yes' and 'no'. Access this page at login.php if you have link disabled

      /*
      *********************************************
      * Database Properties *
      *********************************************
      */

      $dbhost = 'mysql'; // database host (yahoo rep stated this was my host for mysql)
      $dbuser = 'whisper@localhost'; // database user name(yahoo rep stated this was my user name for mysql or phpadmin)
      $dbpass = '******'; // database user password
      (yahoo rep stated use my password for mysql or phpadmin)
      $dbdatabase = 'ecards'; // database with eCards tables (this ecard database is located in the root section in a folder call PHPAdmin. It is not in the funcards folder)
      $tablePrefix = 'gc_'; // prefix of tables created/used by eCards
      (although yahoo rep says the above host/user is correct...these don't work either)


      /*
      *********************************************
      * Card Display Options *
      *********************************************
      */

      $cardsPerRow = 3; // number of cards shown per row on the index.php page
      $rowsPerPage = 2; // number of rows of cards per page on the index.php page
      $orderPop = 'yes'; // whether or not to show the most popular cards (those sent most) first. Takes precedence over the $order option below.
      $order = 'ASC'; // 'ASC' or 'DESC' - set DESC to show most recently added cards first
      $dropShadow = 'yes'; // whether to show cards with a drop shadow or a white background. 'yes' for drop shadow, any other value for white background
      $stampImage = 'classic.gif'; // stamp image to show when dropShadow = 'yes'. Use one of the included ones or create your own.

      /*
      *********************************************
      * Email Text *
      *********************************************
      */
      $subject = 'eCard from $from_name!'; // subject of email sent when a person receives an eCard - $from_name gets replaced with the senders name
      $message = '$from_name has sent you an eCard!\r\nYou can pick it up at the following address:---\r\n\r\n$sitePath/getcard.php?cardid=$cardid'--; // the message sent to someone who receives an eCard. (hyphons used to allow this section to post)

      /*
      *********************************************
      * Card Options *
      *********************************************
      */

      $imageLibrary = 'GD'; // Choose GD or GD2 - use GD2 if it is available
      $maxFileSize = 250; // Maximum image size allowed in upload (measured in KiloBytes)
      $resize_height = 100; // Height of generated thumbnails
      $imagequality = 95; // Quality of thumbnails. Range 0-100

      /*
      *********************************************
      * News Options *
      *********************************************
      */

      $enableNews = 'yes'; // whether or not to show 'news' on index.php
      $newsLocation = 'bottom'; // whether news shows up on the 'right' or the 'bottom' of index.php
      $newsTitle = 'Site News'; // title for news section
      $newsLimit = 2; // number of news stories to show on index.php
      $summaryLength = 350; // number of characters to show for each news item on index.php - news items with more characters will have a link to another page
      $dateFormat ="F j, Y g:i a";// date format for news -
      /*
      *********************************************
      * Statistics *
      *********************************************
      */

      $stats_unique_index_hits_enabled = true; // track number of users who come to the index.php page (1 per browser session)
      $stats_pickupcard_hits_enabled = true; // track number of cards that are picked up (getcard.php)


      /*
      *********************************************
      * Language Options *
      *********************************************
      */
      $defaultLang = 'en';
      $lang = array();
      $lang['en'] = array (
      'file' => "language_en.php",
      'desc' => "English",
      'flag' => "en.gif",
      );

      /*
      ************************************************** *****
      *** Example of adding another language file - add ***
      *** file to inc/lang directory, add image to ***
      *** images/SiteImages/flags directory ***
      ************************************************** *****
      *$lang['fr'] = array (
      * 'file' => "language_fr.php",
      * 'desc' => "French",
      * 'flag' => "fr.gif",
      * );
      ************************************************** ******
      */

      $eCardsVersion = '1.47'; // please don't change this
      ?>

      ----------------------END PHP CODE------------------------------

      I do hope both of you can help me with this when you have a chance.

      BIG HUGS for responding!

      Thank you,

      Valeen

      PS***weaverIT I did try your suggestion but had no luck, setup.php showed the same error...
      Could not connect to the selected database: ecards. Check the config.php file to be sure you set the correct database server, database name, username, and password. Contact your system administrator if you do not know these values.
      {{ DiscussionBoard.errors[1656620].message }}
  • Profile picture of the author mywebwork
    Hi Valeen

    I would have guessed the same thing weaverIT has guessed - and your error message clearly states the you can't connect to the database.

    Can you use PHPMyAdmin to connect to your database? Is there really a database instance named "ecards".

    I would try a simple PHP program to connect to the database just to see if your parameters are correct. I tried to post a sample for you here, but the forum software seems intent on removing the variables (question - what use is the "CODE" tags if you can't use them to display code?).

    A good sample to modify is here:

    PHP MySQL Connect to a Database

    Modify this with your parameters (which I still think are wrong) and see if you can connect to your database.

    If you have difficulty with this I am going to PM you with an e-mail address you can get me at, and I'll send you the code via e-mail - I realize that as a new member you can't reply to a PM yet.

    Best of luck

    Bill
    {{ DiscussionBoard.errors[1657641].message }}
  • Profile picture of the author weaverIT
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[1658001].message }}
    • Profile picture of the author Val10
      I really appreciate you both weaverIT and mywebwork for all the time you've taken to help me solve this issue!

      You guys are the BESTEST!!

      weaverIT I'll do as you suggest and see if it works. I'll post what happens here in the next day or so.

      mywebwork I'll take a look at that good sample to modify you suggested and see if it'll help.

      Many thanks to you both for your kindness and time for helping me. You both are an asset to Warrior Forum.

      xxxx

      Valeen
      {{ DiscussionBoard.errors[1659332].message }}
  • Profile picture of the author customertools
    I have not sleep, so I might have missed something skimming though this, but are you on a shared host? if so the database name would most likely have a prefix on it. yourlogin_ecards

    -Brad
    {{ DiscussionBoard.errors[1664553].message }}
  • Profile picture of the author Val10
    Thank you Lisa, Brad, mywebwork and weaverIT for your help and guidance!

    Mywebwork test worked perfectly! yep-IT WORKS! As far as connecting but can't connect to the database ecards. I use weaverIT advice on privileges and I'm listed as a 'wildcard' with very little privileges so I have to contact Yahoo to help me fix it.

    The config.php file - once changed worked but had issues with privilege problems on Yahoo's end.

    So guess this is resolved.

    Thank you all for your time and guidance!

    xxxxx

    Valeen
    {{ DiscussionBoard.errors[1664690].message }}
  • Profile picture of the author Val10
    Brad I use Yahoo webhosting if this helps.
    {{ DiscussionBoard.errors[1664694].message }}
  • Profile picture of the author Val10
    Question:

    I would like to thank everyone who posted to my reply but don't know how to do it. To the left it shows Thanks: can anyone direct me on how I can do this.

    Many thanks,

    xxxx

    Valeen
    {{ DiscussionBoard.errors[1664732].message }}
    • Profile picture of the author lisag
      Originally Posted by Val10 View Post

      Question:

      I would like to thank everyone who posted to my reply but don't know how to do it. To the left it shows Thanks: can anyone direct me on how I can do this.

      Many thanks,

      xxxx

      Valeen
      Go to each post where you want to thank someone and look at the lower right of that message for the "Thanks" button. Click it.
      Signature

      -- Lisa G

      {{ DiscussionBoard.errors[1664743].message }}

Trending Topics