i am trying to retrieve a integer from a db, increment it by one, then insert it back in, this is what i got. Weird thing is it works once for each recordset, but then never does it again.
<?php
$conn = mysql_connect("localhost", "", "");
mysql_select_db("planetloopdb", $conn);
$query = "SELECT ArticleHits FROM tblarticles WHERE id='$id'";
$result = mysql_query($query)
or die(mysql_error());
$result = mysql_num_fields($result);
$result = array_reverse($result);
$result = $result[9];
$result = ++$result;
$query = "UPDATE tblarticles SET ArticleHits='$result' WHERE id='$id'";
$result = mysql_query($query)
or die(mysql_errno() . mysql_error());
?>
any ideas?