to save my web crawler position that how many pages it crawled i try to save them it in database so that next time it start from the position where it was stoped
first i have table checkpoint with 2 columns id and check
my first step is to get old position from database and store it in $i
$result = mysql_query( "SELECT * FROM checkpoint" ) or die("SELECT Error: ".mysql_error());
while($ch_me = mysql_fetch_assoc($result))
{
$i=$ch_me["check"];
echo "<br>i value in loop ".$i;
break; // need just first check value in db
}
next i have to increment $i value and have to update it into database
while(1)
{ // doing work
$i++;
// save i value in database
mysql_query("UPDATE `checkpoint` SET `id`=1,`check`=$i WHERE 1");
}
now problem i a facing is with update query … it cant update $i value to databse ????? strage it was working for first time then when i run next time , not working
where in update missing