Why does this problem exist? mysqli not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Why does this problem exist? mysqli not working

Post by Mark1954 »

Hi Everyone,
The last fix work good. Now I have this one. Here is the line from the code

Code: Select all

 $mysqli = new mysqli('mySQL', 'root', 'P!r2ed40');
I am using PH 8 on Windows 11. the mysqli extension does not have a semicolon.
I don't know what else to do your help is appreciated.
Mark
User avatar
Benjamin
Site Administrator
Posts: 6930
Joined: Sun May 19, 2002 10:24 pm

Re: Why does this problem exist? mysqli not working

Post by Benjamin »

What is the error message?
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Re: Why does this problem exist? mysqli not working

Post by Mark1954 »

Fatal error: Uncaught Error: Class "mysqli" not found in C:\Apache24\htdocs\Joy\createdb.php:6 Stack trace: #0 {main} thrown in C:\Apache24\htdocs\Joy\createdb.php on line 6
User avatar
Benjamin
Site Administrator
Posts: 6930
Joined: Sun May 19, 2002 10:24 pm

Re: Why does this problem exist? mysqli not working

Post by Benjamin »

Try uncommenting this line in your configuration file, and ensure the path is correct:

extension_dir = "C:\software\php\dist\ext"
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Re: Why does this problem exist? mysqli not working

Post by Mark1954 »

Benjamin,
I'm not sure where you want me to direct the externsion_dir. If it is to my php dir. the I have php 8/*. Can you be more specific?
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Re: Why does this problem exist? mysqli not working

Post by Mark1954 »

actually it is c:\php 8
Mark1954
Forum Newbie
Posts: 7
Joined: Fri Dec 17, 2021 3:39 pm

Re: Why does this problem exist? mysqli not working

Post by Mark1954 »

I think I got it right. The extension_dir. But it didn't work.
ai1ana
Forum Newbie
Posts: 1
Joined: Mon May 30, 2022 9:00 am

Re: Why does this problem exist? mysqli not working

Post by ai1ana »

maybe add another parameter 'bin'
Post Reply