Got a strange problem here:
public function remove_used_scans($scans_used) {
dump($scans_used);
try {
$sql="
UPDATE
ue_game_continent_unit
SET
`number` = `number` - :number
WHERE
(unit_id = :unit_id)
AND
(con_id = :con_id)
";
dump($scans_used['number']);
$stmt = $this->db->prepare($sql);
$stmt->bindParam(':number', $scans_used['number'],PDO::PARAM_INT);
$stmt->bindParam(':unit_id', $scans_used['unit_id'],PDO::PARAM_INT);
$stmt->bindParam(':con_id', $scans_used['continent'],PDO::PARAM_INT);
db_dump($stmt);
$run = $stmt->execute();
dump($run);
return true;
}
catch (PDOException $e) {
//$this->db->rollBack();
error_log('Error reading the game configuration.');
error_log(' Query with error: '.$sql);
error_log(' Reason given:'.$e->getMessage()."\n");
return false;
}
}
The various dumps give:
array (size=3)
âcon_idâ => int 1
âunit_idâ => int 23
ânumberâ => int 1
SQL: [163]
UPDATE
ue_game_continent_unit
SET
number
= number
- :number
WHERE
(unit_id = :unit_id)
AND
(con_id = :con_id)
Params: 3
Key: Name: [7] :number
paramno=0
name=[7] â:numberâ
is_param=1
param_type=1
Key: Name: [8] :unit_id
paramno=1
name=[8] â:unit_idâ
is_param=1
param_type=1
Key: Name: [7] :con_id
paramno=2
name=[7] â:con_idâ
is_param=1
param_type=1
boolean true
The query ârunsâ but isnât changing the value, I donât know if this is another case of where PHP7 is stricter with stuff. Is it something obvious thatâs staring me in the face?