Fatal error: Uncaught exception fixed (Не лениться и не выпендриваться с условиями запросов.)

This commit is contained in:
Igor Barkov [iwork] 2018-12-11 15:09:21 +02:00
parent 85f61ed16d
commit cdda80f70a
1 changed files with 5 additions and 3 deletions

View File

@ -2266,8 +2266,9 @@ function ref_drop()
return false;
}
}
$slot = ['sergi', 'kulon', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'perchi', 'shit', 'boots', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
$user = db::c()->query('SELECT ?af FROM `users` WHERE id = ?i',$slot,$_SESSION['uid'])->fetch_assoc();
$user = db::c()->query('SELECT `sergi`,`kulon`,`weap`,`bron`,`r1`,`r2`,`r3`,`helm`,`perchi`,`shit`,`boots`,`m1`,`m2`,`m3`,`m4`,`m5`,`m6`,`m7`,`m8`,`m9`,`m10` FROM `users` WHERE id = ?i', $_SESSION['uid'])->fetch_assoc();
for ($i = 0; $i <= 20; $i++) {
if ($user[$slot[$i]] && !derj($user[$slot[$i]])) {
dropitem($i + 1);
@ -2852,8 +2853,9 @@ function SolveExp($at_id, $def_id, $damage)
* @return bool
* @throws \Krugozor\Database\Mysql\Exception
*/
function addToDelo($message, $user_id = 0, $type = 1) {
function addToDelo($message, $user_id = 0, $type = 1)
{
if (empty($user_id)) $user_id = $_SESSION['uid'];
db::c()->query('INSERT INTO `delo` (pers, text, type, date) VALUES (?i,"?s",?i,?i)',$user_id,$message,$type,time());
db::c()->query('INSERT INTO `delo` (pers, text, type, date) VALUES (?i,"?s",?i,?i)', $user_id, $message, $type, time());
return true;
}