You aren't assigning the count in your database to a variable, rather just incrementing a new variable (which should throw an error - Notice: Undefined variable: count... - have you error checking disabled?) without actually assigning your database value. Hence why you always get 1 - you're creating a new value of 0 and adding 1 to it every time you refresh.
You would need -
$row = mysql_fetch_row($result);
$count = $row[0];
$count++;
Note I would recommend you should not use count as a field name in your database as it's a reserved word in both MySQL and PHP. It can cause unexpected errors/output. Try having a look at this thread.
Try this (assuming you have PDO and your connection declared), as it has already been pointed out the logic you're using is faulty with your queries.
function updateCount() {
# Update count
$queryUpdate = $db->prepare('UPDATE hits SET hitcount = hitcount + 1');
$queryUpdate->execute();
# Get the updated count value
$queryCount = $dbo->('SELECT hitcount FROM hits');
$queryCount->execute();
# Check that a result is returned and assign result
if ($result = $queryCount->fetch(PDO::FETCH_OBJ) {
return $result->hitcount;
}
}
# Echo returned value
$value = updateCount();
echo $value;