So basically what I'm trying to do is for each row that has been generated by the query, I try to generate a URL and visit that URL. The funny part is that it always only visits the FIRST generated URL and never visits the others.
What am I doing wrong? Please help me.
$query = "SELECT distinct b.productname, b.seller, b.price, b.offerid
from tracker b";
$results = mysqli_query($dbcon, $query);
$rows = array();
$i = 0;
while ($row = mysqli_fetch_assoc($results)) {
$rows[] = $row;
foreach ($rows as $row) {
$url = 'url'.$i;
$$url = 'https://bla.com/tools/tracker.php?productID=' .
$row["productname"] . '&verkoper=' .
$row["seller"] . '&offerid=' .
$row["offerid"] . '&price=' . $row["price"] .
'&productTracken=';
// set URL and other appropriate options
file_get_contents($$url);
$i++;
}
}