im tracking down a weird bug where a variable i have is being changed at some point, and this is where I found the problem:
echo "2. page is $page<br>";
$h = $page;
//Ok everything is done. Now need to update the view counter
$query = "UPDATE pages SET views=views+1 WHERE id=? LIMIT 1";
if($stmt = $db -> prepare($query))
{
$stmt -> bind_param("i", $page);
$stmt ->execute();
$stmt ->close();
}
else
dberror();
echo "3. page is $page<br>";
$page = $h;
echo "4. page is $page<br>";
So I am getting this:
2. page is page
3. page is 0
4. page is page
I just added in that $h variable to try and fix the problem and it worked. So for some reason the sql query is destrying my page variable. Does anyone know why this would happen?