<?php $db['host']='localhost'; $db['user']='root'; $db['pass']=''; $db['db']='lib'; $conn=@mysql_connect($db['host'],$db['user'],$db['pass']) or die("Ошибка БД"); $db=@mysql_select_db($db['db']) or die("Ошибка БД");
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"),0);
$q=mysql_query("SELECT * FROM `user` WHERE `userid` LIMIT $count");
while($res=mysql_fetch_assoc($q))
{
$userid=$res['userid'];
$data = file_get_contents('
localhost/json'.$userid);
$json = json_decode($data,true);
$x = $json[book];
if ($x > 5) {
$insert=mysql_query("INSERT INTO `uicheck` (`userid`,`book`) VALUES ('$userid','$x')");
}
}
?>