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.
Am I in for a world of hurt later?
Moderator: General Moderators
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
- 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?
I still do - blissfully unaware
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.
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.
- 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?
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/
http://dev.mysql.com/downloads/connector/php-mysqlnd/
(#10850)
- 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?
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!
- 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?
I actually don't know of a good PHP ORM
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?
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?
- 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?
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.Kieran Huggins wrote:Anyone use an ORM in PHP that doesn't suck?
As for general DB connectivity, PDO FTW (as Kieran would say)
- 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?
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!
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!
- 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?
Yes, you can have extensions mysql and pdo_mysql at the same time as I recall.
(#10850)