PHP/MySQL | Помогите
Хз, не пашет, я год не кодил, чё не так?
<?php
include 'head.php';
auth();
$uid=$user['id'];
$opit=$user['shahtaLevel']*3;
$shahta=$user['shahta'];
if(isset($_GET['dig'])){
$mo=$db->query("UPDATE `users` SET `money`+='$shahta' WHERE `id`='$uid'");
header('Location: index.php');
}
echo 'Ник: '.$user['login'].' Монетки: '.$user['money'];
?>
<br><br>
<center><a href="?dig">Добыть монетки</a></center>
<br><br><br>
<a href="/game/logout.php">Выйти</a>
<?php
include 'head.php';
auth();
$uid=$user['id'];
$opit=$user['shahtaLevel']*3;
$shahta=$user['shahta'];
if(isset($_GET['dig'])){
$mo=$db->query("UPDATE `users` SET `money`+='$shahta' WHERE `id`='$uid'");
header('Location: index.php');
}
echo 'Ник: '.$user['login'].' Монетки: '.$user['money'];
?>
<br><br>
<center><a href="?dig">Добыть монетки</a></center>
<br><br><br>
<a href="/game/logout.php">Выйти</a>
IndiS, `money`+='$shahta'
IndiS, `money` = `money` + '$shahta'
$mo=$db->query("UPDATE `users` SET `money` = `money` + '$shahta' WHERE `id`='$uid'");
а вообще вот так вот лучше кек
$mo=$db->query("UPDATE `users` SET `money` = `money` + ? WHERE `id`= ?",array($shahta,$uid));
$mo=$db->query("UPDATE `users` SET `money` = `money` + ? WHERE `id`= ?",array($shahta,$uid));
FLOWAP (19.12.2018 в 23:14)
а вообще вот так вот лучше кек
$mo=$db->query("UPDATE `users` SET `money` = `money` + ? WHERE `id`= ?",array($shahta,$uid));
а вообще вот так вот лучше кек
$mo=$db->query("UPDATE `users` SET `money` = `money` + ? WHERE `id`= ?",array($shahta,$uid));
а если это обёртка к mysql?