shuttle-export icon indicating copy to clipboard operation
shuttle-export copied to clipboard

mysql_* functions is deprecated, using MySQLi or PDO instead

Open peter279k opened this issue 5 years ago • 3 comments

As title, it seems that the mysql_* functions are deprecated/removed since PHP version is 7.0.

And we should consider using the PDO and MySQLi to be compatible with PHP-7.x versions.

peter279k avatar Jun 25 '19 03:06 peter279k

HI @peter279k!

MySQLi is currently supported(and the default). There is no PDO support at this point, but we haven't experienced situations where it's the only available option(i.e. where neither mysql_ no mysqli_ are available, but PDO is enabled).

emohamed avatar Jun 25 '19 04:06 emohamed

Hi @emohamed. thank you for your reply and explanation.

I have seen that the MySQL and MySQLi have their classes in this repository.

Some suggestions I recommend are as follows:

  • I think we can consider checking whether the mysql_* functions are available. If not, throw exception message to tell developers using MySQLi or PDO classes instead.
  • We can add the PDO support to connect the MySQL database if possible.

These suggestions I think we can help them once they're accepted :).

peter279k avatar Jun 25 '19 05:06 peter279k

Hi @peter279k

I think I see your point. You mean that currently if both mysql_ and mysqli_ extensions are not available, the result would be fatal error without clear message that at least one of those is required?

We can add the PDO support to connect the MySQL database if possible.

Sure, that would be great. Please feel free to fork the repo & open a pull request with the change.

Thanks!

emohamed avatar Jun 25 '19 11:06 emohamed