Skip to content
Advertisement

How can I access a MySQL database without using PHP PDO?

I have this script which uses PHP PDO to access the MySQL database, but the problem is my hosting provider has disabled PHP PDO, so now I’m stuck and have no idea how to change this code to access the database without PHP PDO:

JavaScript

My database works fine as I have used this MySQL test script to connect to it and it works:

JavaScript

Advertisement

Answer

As JvdBerg says, you can switch hosts or change to MySQLi

Here is a quick change from PDO to MySQLi

From

JavaScript

to

JavaScript

And

from

JavaScript

to

JavaScript

Rinse, lather, repeat for the rest of the class methods.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement