I'm using PDO, and my $_POST['arraywithdata']
is an array filed with numeric values. I think that this is not enough secure, I just wan't to be sure and prevent myself from a hack.
This is my code:
$arr = $_POST['arraywithdata'];
$SQL->query("UPDATE `data_s` SET `set` = 1 WHERE `id` IN " . implode(", ", $arr));
As you can see, I'm not checking if the post code in a int or something.
Should I rather use something like:
implode(", ", (int) $arr)
?
I guess the above will not work, since array can not be an integer.