Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching on mysqli over mysql

Tags:

php

mysql

I have mysql installed and now I want to work on mysqli with new database.

Does it affect my previous database which is in mysql if I enable mysqli in phpmyadmin?

like image 213
Shikha Avatar asked Jul 02 '15 07:07

Shikha


2 Answers

mysqli -> MySQL Improved Extension.

The mysqli extension, or as it is sometimes known, the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer. The mysqli extension is included with PHP versions 5 and later.

You just have to change the code you have done using mysql. No Need to change the database. mysqli methods also use the mysql database.

This may help

like image 168
Sougata Bose Avatar answered Oct 06 '22 00:10

Sougata Bose


if you're switching from MySQL to MySQLi, I suggest you to go for PHP Data Objects (PDO) with Prepared Statements.

It could give you little bit of burden initially, but once you create your own PDO class, you will be so glad upon your PDO work, believe me.

I took help from below links when I started it. try'em.

http://php.net/manual/en/book.pdo.php

http://code.tutsplus.com/tutorials/php-database-access-are-you-doing-it-correctly--net-25338

like image 45
Hytool Avatar answered Oct 06 '22 02:10

Hytool