1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[NEED HELP] Fatal error: Call to undefined function mysqli_connect()

Discussion in 'PHP & Perl' started by sajid_buriro, May 9, 2012.

  1. sajid_buriro

    sajid_buriro Regular Member

    Joined:
    Feb 28, 2011
    Messages:
    269
    Likes Received:
    48
    Hi guys, i was trying to use a viral fb script and i was facing this problem in admin area also that script was not performing well, i am wondering what could be the problem.
    The error which i get is:

    Fatal error: Call to undefined function mysqli_connect() in/home/yourbest/public_html/specxxxxxxxx.com/new/include/db/Db_connection.php on line 42

    so what could be the problem? is it with my hosting or that Db_Connection.php? sorry i am not much familiar with php stuff.
    I have a linux based Cpanel X system,
    [TR="class: row-even"] [/TR] [TR="class: row-odd, bgcolor: #F3F3F3"] [/TR]
    PHP version 5.2.17MySQL version 5.1.62-cll
    [TR="class: row-odd, bgcolor: #F3F3F3"] [/TR]
    cPanel Version 11.32.2 (build 25)
    Thanks for your time..
     
  2. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,229
    Occupation:
    Retired
    Location:
    Old Peoples Home
    In the config file do you have a choice of databases?
    If there is one saying Mysqli, try changing it to MySQL and see if that helps.
     
    • Thanks Thanks x 1
  3. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    Your host doesn't have the MySQLi extension activated. Ask them to add it or if they allow htaccess/php.ini to change directives, use it to enable mysqli.
     
    • Thanks Thanks x 1
  4. sajid_buriro

    sajid_buriro Regular Member

    Joined:
    Feb 28, 2011
    Messages:
    269
    Likes Received:
    48
    No i don't have a choice over there, it is like this only..

    //database access

    $GLOBALS['db_host'] = 'localhost';

    $GLOBALS['db_name'] = ' ';

    $GLOBALS['db_user'] = ' ';

    $GLOBALS['db_password'] = ' ';


    //database tables names

    $GLOBALS['fb_users_table_name'] = 'facebook_viral_users';

    $GLOBALS['fb_settings_table_name'] = 'facebook_viral_settings';



     
  5. sajid_buriro

    sajid_buriro Regular Member

    Joined:
    Feb 28, 2011
    Messages:
    269
    Likes Received:
    48
    Ok i'll try to figure out how to do that.. thanks pal..