'Can I use Mysqli inside of a Mysql database?

Can someone please tell me if I need to upgrade my server to use mysqli? I unfortunately for now see the need to use mysqli for numerous reasons but my hosting company only offers mysql database... Can I use mysqli statements in mysql database?



Solution 1:[1]

Use PDO for safer variable management and data transfer, if built properly it helps prevent sql injection. PDO on its own does not offer any data security or privacy, which in your case of ecommerce, is of utmost importance these days. To assist with that, you will need SSL (Secure Socket Layer) certificate, your web host can help install it, and for some maybe even offer a free one.

Solution 2:[2]

Andy, MySQL is the database client and server itself. MySQL API along with MySQLi and PDO API are part of the PHP language. It may not be completely clear when learning new things where something begins and something else with a similar name separates from that. the MySQL API within PHP is deprecated and thus will eventually be removed entirely so you don't want to code with that. Your host should thus already have MySQLi turned on within PHP, but the better solution of PDO API makes the most sense.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex
Solution 2 Niagaradad