mikecao / sparrow

A simple database toolkit for PHP
MIT License
289 stars 68 forks source link

PHP 5.5.0 compatibility #13

Closed rooduck closed 8 years ago

rooduck commented 10 years ago

Hi Mike.

As you can see, i just replaced all mysql* functions by mysqli* ones, because mysql_* functions are deprecated since PHP 5.5.0. I use this updated version in my project, inserting and selecting is working fine.

mikecao commented 10 years ago

Mysqli is already supported. It creates a mysqli object instead of using the functions.

rooduck commented 10 years ago

It's not about "supported" or "not supported", i just think that using deprecated functions is a bad practice. But if that's a feature, not a bug, then it's ok.

kafene commented 10 years ago

Not everyone is on 5.5 yet. So, it's not deprecated for most people.

I kind of do agree with removing it, and just use pdo_mysql for all mysql connections, I can't think of any reason not to just use PDO internally in the library, for all supported connection types, and it should be transparent to users. It would simplify things as well.

But that can come in time as elsewhere mike said he's looking at doing a rewrite.

mikecao commented 10 years ago

The point is you have to provide people options. There are lots of installations that don't have PDO or mysqli installed. Since you can choose whatever connection type you want, just choose mysqli if that's what works for you. It shouldn't matter if there is support for the original mysql driver if you're not using it.

rooduck commented 10 years ago

Ok, i see your point.