+ Changed from MySQL to MySQLi native driver.

+ Added 2 new functions in DataBase class: fetch($query) and num_rows($query)

git-svn-id: https://svn.pioder.pl/uf-svn/uF@20 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2009-05-03 10:50:00 +00:00
parent 6cc36dc266
commit b1f37b6ea5
43 changed files with 296 additions and 193 deletions

View File

@@ -13,10 +13,14 @@ if (is_dir('install'))
die('<font color="red" face="Verdana" size="6">Please delete or rename catalog "install"</font>');
}
if (phpversion()<'5.0.7')
{
die('&micro;Forum requires PHP 5.0.7 or later');
}
//set global preferences from DataBase
$sql="SELECT * FROM ".CONFIG_TABLE."";
$query=DataBase::sql_query($sql,'CRITICAL','Could not obtain config information');
while($result=mysql_fetch_array($query))
while($result=DataBase::fetch($query))
{
if (($result['name']=='') or ($result['name']=='0'))
{
@@ -49,7 +53,7 @@ if ($_SESSION['uid']>0)
$ip = $_SERVER['REMOTE_ADDR'];
$uid = $_SESSION['uid'];
$sql = "SELECT `IP`, `u_id`, `motive` FROM ".BANLIST_TABLE." WHERE `IP`='$ip' OR `u_id`='$uid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain ban information'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain ban information'));
$motive = $result['motive'];
$db_ip = $result['IP'];
$db_uid = $result['u_id'];
@@ -73,7 +77,7 @@ else
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='-1'";
}
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain loged user information');
$userdata = mysql_fetch_array($query);
$userdata = DataBase::fetch($query);
define('RANK', $userdata['rank']);
define('TABLES_WIDTH',$forum_config['tables_width']);