Mysqli support - test or complain?
- From: martin@xxxxxxxxxxxxx (Dave M G)
- Date: Mon, 10 Dec 2007 17:16:02 +0900
PHP List,
Based on what seemed to be good advice to switch to using mysqli for interacting with a MySQL database, I built a content management system that uses mysqli for all it's calls.
It works great on a lot of my servers. However, I just discovered that one web hosting service I use does not have mysqli enabled. I ran the phpinfo() command and they are running 5.2.5, but the configure command does not contain "--with-mysqli".
I would like the scripts I've written to be somewhat portable, but I'm unsure of whether or not I should assume that mysqli is in use.
I see it as being a situation of essentially two options.
One is based on the assumption that mysqli is as likely not to be available as it is to be installed. In this case I should write my scripts to test whether it exists and then use either mysqli or straight mysql commands as appropriate. If this is the way to go, what do I do to test for the existence of mysqli from within a PHP script?
The other is to assume that recent installs and upgrades of PHP > 5 should have mysqli because that's the currently preferred way of doing things, and therefore I should contact the web host and ask that they install it, or I find a different host.
Which assumption should I be proceeding with?
Thank you for any advice or assistance.
--
Dave M G
.
- Follow-Ups:
- Re: [PHP] Mysqli support - test or complain?
- From: Larry Garfield
- Re: [PHP] Mysqli support - test or complain?
- From: "Daniel Brown"
- Re: [PHP] Mysqli support - test or complain?
- From: Richard Heyes
- Re: [PHP] Mysqli support - test or complain?
- From: Per Jessen
- Re: [PHP] Mysqli support - test or complain?
- Prev by Date: Re: [PHP] Shipping Address on Paypal
- Next by Date: Drawing anti-aliased lines using the GD library
- Previous by thread: [PHP] Shipping Address on Paypal
- Next by thread: Re: [PHP] Mysqli support - test or complain?
- Index(es):
Relevant Pages
|