Re: Mysqli support - test or complain?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

You can:

1. Change your program to use the much more common mysql extension and
   forget about mnysqli for the time being (this is what I would do).
   You can switch to mysqli when its use becomes prevalent.
2. State that mysqli is required and not change anything (not advisable)
3. Alter your program to support both - use mysqi if it's avilable,
   mysql if it's not. If you use an API and not the mysqli functions
   directly this won't be too much hassle.

Your last option to to assume that it's installed is very bad indeed. You shouldn't ever make assumptions, particularly when your dealing with software distributions.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux