Page 1 of 1

Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 9:15 am
by seodevhead
Hey guys... just a quick question.

All my php/mysql scripts I use and write currently utilize the older mysql extension (as opposed to the new and improved mysqli extension). Having to update my scripts to work with mysqli would be nightmarish, since I did not utilize and object oriented approach to database interactivity. But I am perfectly content with the standard mysql extension.

My question is... am I in for a world of hurt a year, 2 years maybe even 5 years from now, having stuck with the mysql extension? Does anyone know what the shelf-life of this extension is? Anyone here still write php using the mysql extension? Thanks for any advice.

Re: Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 11:56 am
by Kieran Huggins
I still do - blissfully unaware 8) I guess it's only a problem if you *need* to upgrade PHP for that particular app in the future, otherwise the extension isn't going anywhere.

That being said, maybe now's the time to start thinking about using an ORM as a database abstraction layer so you have a nice, clean separation when you do make the switch.

Re: Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 1:16 pm
by Christopher
One reason to upgrade is the new MySQL native driver support coming in new versions of PHP. I believe it only supports mysqli.

http://dev.mysql.com/downloads/connector/php-mysqlnd/

Re: Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 2:17 pm
by seodevhead
Thanks for the advice guys. As far as an ORM... would you recommend using Zend's PDO interface? I want to use something that will be around for awhile and know there will be good support for and future upgrades of PHP 6/7/8 will not break whatever code I use. Thanks!

Re: Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 2:23 pm
by Kieran Huggins
I actually don't know of a good PHP ORM :oops:

There are a few nice ones in Ruby, I think about porting datamapper from time to time. But it's just not high enough on the list.

Anyone use an ORM in PHP that doesn't suck?

Re: Am I in for a world of hurt later?

Posted: Thu Jan 24, 2008 8:15 pm
by Chris Corbyn
Kieran Huggins wrote:Anyone use an ORM in PHP that doesn't suck?
Propel. Despite ~Ninja having a hard time getting off the ground with it during the last round of "which ORM is best" I've always had a great deal of success with it. It's flexible and it's a pleasure to work with.

As for general DB connectivity, PDO FTW (as Kieran would say) :)

Re: Am I in for a world of hurt later?

Posted: Fri Jan 25, 2008 7:32 am
by seodevhead
Is there some sort of built-in PDO within PHP? Or would I have to use a class that utilizes PDO like a Zend_Db?

Also, can I use both PDO and maintain all my old scripts with mysql extension? Cause I know you can't run both the mysql and mysqli extensions at the same time. Wondering if this is the case for PDO as well? Thanks!

Re: Am I in for a world of hurt later?

Posted: Fri Jan 25, 2008 10:47 am
by Christopher
Yes, you can have extensions mysql and pdo_mysql at the same time as I recall.