I have that simple php code:
$sql= 'SELECT ID, fb_postid, scheduled FROM `posts` WHERE clicks = "" AND fb_postid !="" AND scheduled < NOW() order by ID ASC LIMIT 10;';
$result = mysqli_query($link, $sql);
print_r($result);
while ($row = mysqli_fetch_assoc($result)) {
$clicks=fbcall($fbtoken, $row['fb_postid']);
$update="UPDATE `posts` SET `clicks`='".$clicks."' WHERE id='".$row['ID']."'";
$result = mysqli_query($link, $update);
print("POSTID: " . $row['fb_postid'] . " - Clicks: " . $clicks ."<br>");
};
The MYSQL SELECT gets 10 Lines from DB loops through the line in the While Loop, gets "clicks" from function fbcall and then should update all 10 lines with the values from "clicks" to the db. if i run the code without update i get 10 results printed but if i run with mysqli_update i just get 1 row updated. Anybody any Idea why?