#89 Check that MySQL extension is loaded

XOOPS_2.2
closed
5
2012-09-25
2005-02-16
Dave Lerner
No

This check should be added before the @mysql_connect
call in mysqldatabase.php:

extension_loaded('mysql') or trigger_error('mysql
extension not loaded', E_USER_ERROR);

(A new language constant should probably be added for
the error text.)

Reason:

Because of the @ in @mysql_connect, if PHP doesn't have
the MySQL extension loaded, the script will stop with
no indication of the problem, even if PHP debug is on.

Even if MySQL works properly when XOOPS is first
installed, a server configuration change, such as a PHP
upgrade, could result in MySQL being "lost". That's
why this check should be done dynamically.

Discussion

  • Jan Pedersen

    Jan Pedersen - 2005-04-19

    Logged In: YES
    user_id=841117

    (A new language constant should probably be added for
    the error text.)

    Difficult to say the least... we need the database to tell
    us which language is the current one... so without it we
    cannot really know which language to give the error message in.

     
  • Dave Lerner

    Dave Lerner - 2005-04-19

    Logged In: YES
    user_id=936559

    Good point. In that case, "mysql extension not loaded" is
    probably best. If someone doesn't know what that means, he
    can post it on the support forum and ask. But that's much
    better than posting "the page is blank".

     
  • Jan Pedersen

    Jan Pedersen - 2005-04-19

    Logged In: YES
    user_id=841117

    Fixed in CVS and waiting for review before merging to the trunk.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks