I used all both of your tipps: Changed to that but the Mysql Statement doesnt get the value...
Look that:
try {
$sql = "SELECT a_idname FROM t_users WHERE a_zone_num <> -1;";
$users = $conn3->query($sql);
while ($row = $users->fetch()) {
$result = $users->fetch(PDO::FETCH_ASSOC);
foreach($result as $value) {
echo $value;
$Add_Cash = $conn1->prepare("UPDATE bg_user SET cash = cash + ':cash' WHERE user_id = ':result';");
$Add_Cash->bindParam(':cash', $cash);
$Add_Cash->bindParam(':result', $value);
$Add_Cash->execute();
$Count++;
}
}
$conn3 = null;
}
catch (PDOexception $e) {
echo "Error is: " . $e-> etmessage();
}
将$ sql更改为
$sql = "SELECT a_idname FROM t_users WHERE a_zone_num <> -1;";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.