Basics: MySQL - MySQLi

Post here is you are having problems with any of the tutorials.
Post Reply
Lykos22
Posts: 19
Joined: Sat Mar 24, 2012 9:03 am

Basics: MySQL - MySQLi

Post by Lykos22 »

Hi Jacek, I was watching recently your video on Basics about the mysqli. I'm really sorry for posting about this subject, as there are a lot of discussions, as you've said about it.

I 'm still using the mysql_* mostly, as I'm writting more proceedurePHP than OOP, just because i'm used to this 'approach'. I'm not saying that I'm not using and mysqli at all, I use it more in OOP.

As its been a while since you've published this tutorial and since in php.net there are alot of notification telling about mysql_* is going to deprecated as of PHP 5.5.0, does this mean that the change to mysqli_ is a MUST now? the mysql_* will not be updadted any more or stop "existing"?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Basics: MySQL - MySQLi

Post by jacek »

It means that some time after 5.5 the mysql_* functions will be removed. It would be a good idea to get used to the replacement before that happens. You can use mysqli in the same way as the old mysql version simpley by adding the "i" mysql_connect => mysqli_connect for example.

Also worth noting that 5.5 and then 5.6 are both a long way off so there is no need to panic just yet.
Image
Lykos22
Posts: 19
Joined: Sat Mar 24, 2012 9:03 am

Re: Basics: MySQL - MySQLi

Post by Lykos22 »

jacek wrote:You can use mysqli in the same way as the old mysql version simpley by adding the "i" mysql_connect => mysqli_connect for example.
Well, it looks to me (at least) a bit different as the mysqli_* looks like more OO, so if there's a php page with simple PHP script its getting a little bit weird all this mix. :?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Basics: MySQL - MySQLi

Post by jacek »

You can use it OO style or procedural style. I prefer the OO version but it is possible to just add an "i" to all the function names.
Image
Lykos22
Posts: 19
Joined: Sat Mar 24, 2012 9:03 am

Re: Basics: MySQL - MySQLi

Post by Lykos22 »

jacek wrote:You can use it OO style or procedural style. I prefer the OO version but it is possible to just add an "i" to all the function names.
I have recently tried it. I hadn't read the manual till then about it to be honnest :roll:, but still has some differences not only in syntax, for example there's no mysql_result() function in msqli
Post Reply