3

in the first place it seems like I do not have mysqli installed, after running this if:

if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!!';
} else {
    echo 'Phew we have it!';
}

It returned the "we don't have mysqli!!!".

So after looking on how to install this I couldn't really find a way, after visiting http://php.net/manual/en/mysqli.installation.php, I scrolled down to find the "PHP 5.3.0 and newer" section where it says I wouldn't need to worry about installing it. So what should I do, and if there's a command I should run where should I run it? I'm using XAMPP to run php in case that matters.

Thanks in advance!

Edit: "extension=mysqli" is enabled in php.ini

Edit2: I'm on windows 10.

Fábio Rodrigues
  • 51
  • 1
  • 1
  • 3
  • https://stackoverflow.com/questions/666811/fatal-error-class-mysqli-not-found please refer this it may helps you. – Siva Mar 05 '18 at 11:14
  • @Siva I've been to that post ,although it is from 2009, the most voted comment sent me directly to the same site I linked in my post, which didn't really help me. – Fábio Rodrigues Mar 05 '18 at 11:27
  • In Windows 10 for mysqli to work in PHP 7.3 you should add PHP directory to the PATH. This behavior was not there in PHP 7.0.27 – bansi May 15 '19 at 03:50

1 Answers1

4

If your on linux install mysql php extension

sudo apt-get install php7.2-mysql
Jagadesha NH
  • 2,529
  • 2
  • 23
  • 41