1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

MySQLi connection fails

Discussion in 'Databases' started by Paul8368, Dec 1, 2018.

  1. #1
    Hi

    I'm attempting to design a new web site and connect to the MySQL database.

    Unfortunately the last time I coded was years ago and the syntax has updated

    [01-Dec-2018 13:43:43 UTC] PHP Fatal error: Class 'mysqli_connect' not found in

    I think its an error of not defining the connection properly.

    I've tried looking at the Oracle help / forum (yes I signed up) but can't see in initial set up tutorial that goes through the basics so that I can verify I have everything in place.

    This is further complicated by it being a relational database in innodb format which I haven't used before either.

    Can someone point me in the right direction of where I can get help from?

    Paul
    SEMrush
     
    Paul8368, Dec 1, 2018 IP
    SEMrush
  2. bRainWithStorm

    bRainWithStorm Active Member

    Messages:
    476
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    68
    #2
    mysqli_connect not found. Did you enable mysql extension in php.ini file ?

    extension=php_mysqli.dll
     
    bRainWithStorm, Dec 1, 2018 IP
  3. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    340
    Likes Received:
    17
    Best Answers:
    5
    Trophy Points:
    138
    #3
    Please refer to this link for help: https://www.w3schools.com/php/php_mysql_connect.asp
    If there is any issue in your database connection query, then replace with the below code:
    <?php
    $con=mysqli_connect("localhost","username","password","databasename") or die(mysqli_error($con));
    ?>

    hope this helps :)
     
    hostechsupport, Dec 3, 2018 IP