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
     
    Paul8368, Dec 1, 2018 IP
  2. bRainWithStorm

    bRainWithStorm Well-Known Member

    Messages:
    476
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    118
    #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:
    413
    Likes Received:
    23
    Best Answers:
    7
    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