My update query is not working with my variable $id BUT does work when I use the literal number 29, for example. I have var_dumped $id and I get INT(29). Has something changed recently because I copied code that has worked in the past.
$id = (ISSET($_GET['id'])) ? intval($_GET['id']):0;//prevents sql inject
var_dump($id);
My query that works is the following:
$sqlUpdate = $db->query("UPDATE sites SET site_name='$site_name',population='$population' WHERE id=29");
This query doesn't work:
$sqlUpdate = $db->query("UPDATE sites SET site_name='$site_name',population='$population' WHERE id=$id");