Оптимизация запросов в БД.
This commit is contained in:
+8
-6
@@ -3834,6 +3834,7 @@ function show_item($row, $txt, $place)
|
||||
function magicinf($id)
|
||||
{
|
||||
return mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '{$id}' LIMIT 1"));
|
||||
return db::c()->query()->fetch_assoc_array()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3844,11 +3845,14 @@ function showpersinfo($id) {
|
||||
}
|
||||
|
||||
|
||||
// показать перса в инфе
|
||||
/**
|
||||
* Отображение персонажа в main.php
|
||||
* @param $id
|
||||
*/
|
||||
function showpersinv($id)
|
||||
{
|
||||
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
||||
$dressed = array();
|
||||
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $id)->fetch_assoc();
|
||||
$dressed = [];
|
||||
$r = mysql_query("SELECT * FROM `inventory` WHERE
|
||||
`id` = '$user[helm]' OR `id` = '$user[weap]' OR `id` = '$user[plaw]' OR `id` = '$user[bron]' OR
|
||||
`id` = '$user[rybax]' OR `id` = '$user[belt]' OR `id` = '$user[sergi]' OR `id` = '$user[kulon]' OR
|
||||
@@ -3866,7 +3870,7 @@ function showpersinv($id)
|
||||
echo($user['align'] > 0 ? $user['align'] : "0"); ?>.gif">
|
||||
<img src="i/klan/<? ClanImage($user['klan']); ?>.gif">;
|
||||
<B><?= $user['login'] ?></B> [<?= $user['level'] ?>]
|
||||
<a href=inf.php?<?= $user['id'] ?> target=_blank><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11
|
||||
<a href=inf.php?<?= $user['login'] ?> target=_blank><IMG SRC=i/inf.gif WIDTH=12 HEIGHT=11
|
||||
ALT="Инф. о <?= $user['login'] ?>"></a>
|
||||
|
||||
<TABLE cellspacing=0 cellpadding=0>
|
||||
@@ -4374,8 +4378,6 @@ function dropitemid($slot, $id)
|
||||
$user[$slot1] = 0;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
echo mysql_error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user