Answer the question
In order to leave comments, you need to log in
Curl restarts itself, what's the problem?
$page =mysql_query("SELECT * FROM `link` WHERE `onoff` > '2' AND `status` = '0'");
$check = mysql_num_rows($page);
$res = mysql_query("SELECT * FROM `groups` WHERE `idgroup` IN ( 'me','820886501366475') ");
$res1 =mysql_query("SELECT * FROM (SELECT * FROM `link` WHERE `onoff` > '2' AND `status` = '0' ORDER BY `share` LIMIT 1) a ORDER BY `id`");
$row1 = mysql_fetch_array($res1);
$today = date("F j, Y, g:i a");
if($check < 1)
{
echo "Записей нет";
}
else
{
while($row = mysql_fetch_array($res))
{
$attachment = array(
'id' => $id,
'access_token' => $token,
'link' => $row[link]
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/v2.4/feed');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output
$result = curl_exec($ch);
curl_close ($ch);
mysql_query("INSERT INTO `status` (`id`, `idurl`, `idgroup`, `name`, `stat`, `status`, `user`) VALUES (NULL, '$as', '$row[idgroup]', '$row[name]', '$result[3]', '$result', '$row[user]');");
echo $result[3];
echo "<br />";
echo $da;
mysql_query("UPDATE `link` SET `status` = `status` + 1 WHERE `id` = ".$row1['id'].";");
}
}
mysql_close();
if($check < 1)
{
echo "Записей нет";
}
else
{
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question