Ignore:
Timestamp:
Nov 20, 2009, 3:17:04 PM (14 years ago)
Author:
nikrou
Message:

Feature 1244 resolved
Replace all mysql functions in core code by ones independant of database engine

Fix small php code synxtax : hash must be accessed with [ ] and not { }.

File:
1 edited

Legend:

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

    r4280 r4325  
    9393include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    9494@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
     95include(PHPWG_ROOT_PATH .'include/dblayer/functions_mysql.inc.php');
    9596
    9697if(isset($conf['show_php_errors']) && !empty($conf['show_php_errors']))
     
    105106
    106107// Database connection
    107 @mysql_connect( $conf['db_host'], $conf['db_user'], $conf['db_password'] ) or my_error( 'mysql_connect', true );
    108 @mysql_select_db( $conf['db_base'] ) or my_error( 'mysql_select_db', true );
    109 
    110 defined('PWG_CHARSET') and defined('DB_CHARSET')
    111   or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined');
    112 if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') )
    113 {
    114   if (DB_CHARSET!='')
    115   {
    116     pwg_query('SET NAMES "'.DB_CHARSET.'"');
    117   }
    118 }
    119 elseif ( strtolower(PWG_CHARSET)!='iso-8859-1' )
    120 {
    121   fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info());
    122 }
     108$pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
     109                              $conf['db_password'], $conf['db_base'])
     110  or my_error('pwg_db_connect', true);
     111
     112pwg_db_check_charset();
    123113
    124114load_conf_from_db();
Note: See TracChangeset for help on using the changeset viewer.