Ignore:
Timestamp:
Mar 21, 2010, 11:51:36 PM (15 years ago)
Author:
nikrou
Message:

Feature 1255 :
only one function
use exceptions to deal with differents possible errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r5235 r5236  
    105105
    106106// Database connection
    107 $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
    108                               $conf['db_password'], $conf['db_base']);
    109 pwg_select_db($conf['db_base'], $pwg_db_link);
     107try
     108{
     109  $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
     110                                $conf['db_password'], $conf['db_base']);
     111}
     112catch (Exception $e)
     113{
     114  my_error(l10n($e->getMessage(), true);
     115}
    110116
    111117pwg_db_check_charset();
Note: See TracChangeset for help on using the changeset viewer.