Ask coding questions

← Back to all posts
PHP and MySQLi
Lightcaster5

I don't know if it is simply disabled on repl.it or I am doing something wrong but I cannot connect to my SQL database through my PHP files. This is what I am currently doing:

But whenever I run the page with the connection script I get the following error:

Uncaught Error: Class 'mysqli' not found in my-project-here

Voters
Loshad
charliekmcmahon
DiscordOdysseyD
Lightcaster5
Comments
hotnewtop
[deleted]

Seems debatable whether you can do what you ask. Here is a comment I came across by Googling: https://repl.it/talk/ask/How-do-I-use-a-database-with-the-new-php-server/15708

Lightcaster5

@malvoliothegood I don't believe you understand my post; I am asking whether or not it is possible and IF SO, what am I doing wrong/where can I go to learn how to achieve my goal?

[deleted]

@Lightcaster5 I think I understood what you meant. My answer said I don't think you can do this and I included a link to an old conversation that basically said this. If you find an answer that lets you do such a hook up let me know. All the best.

Lightcaster5

@malvoliothegood Thanks, after a bit of testing and using echo phpInfo(); I've found that $pdo = new PDO(Stuff here); works but throws an exception because there are No Drivers Found and in phpInfo(); under the PDO section it says No Value for where it is saying if drivers are enabled. Thanks for the help!

[deleted]

@Lightcaster5 Thanks for the info. You can easily develop using PHP, and MySql applications using the XAMPP, WAMP or LAMP packages. I have used the first two in the past and built a WordPress site locally before hosting it on the web. I have also used it to teach programming and relational databases when I was a teacher.