Am I in for a world of hurt later?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Am I in for a world of hurt later?

Post 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.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

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

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post 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/
(#10850)
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

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

Post 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!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

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

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

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

Post 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) :)
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

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

Post 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!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

Yes, you can have extensions mysql and pdo_mysql at the same time as I recall.
(#10850)
Post Reply