Re: Mysqli support - test or complain? [SOLVED]
| From: | Robert Cummings | Date: | Tue, 11 Dec 2007 04:22:15 +0000 |
| Subject: | Re: Mysqli support - test or complain? [SOLVED] | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265657@lists.php.net to get a copy of this message | ||
On Tue, 2007-12-11 at 13:02 +0900, Dave M G wrote:
> Zoltan, Per, Richard, Chris, Daniel, Larry,
>
> Thank you for responding.
>
> I have created a method in the class that handles my database
> connections that will first test on extension_loaded(mysqli) before
> connecting to the database.
>
> Then I store the result in a session variable for reference, so future
> calls will use the correct mysqli or "regular" syntax.
>
> Thank you for helping me to find this solution. My scripts are that much
> more portable now.
You use a session variable for that? That's entirely the wrong place to
store something like which database API is installed. It should a class
variable or global configuration variable. Heck, I'd say it's more
appropriate to do extension_loaded( 'mysqli' ) on every call than to use
a session variable.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................