tjek credit og set status, hvis ingen credits vil ikke saette til 0
/** get url id **///$id = isset($_GET['id']) ? $_GET['id'] : '';
$result = mysql_query ("SELECT * FROM links limit 1");
while ($row = mysql_fetch_array($result))
$id = $row["linkid"];
//get campain
//Get campain name
$result = mysql_query ("SELECT * FROM links Where linkid='$id' ");
while ($row = mysql_fetch_array($result))
$campain = ($row["campain"]);
//Get awaible credits
$result = mysql_query ("SELECT * FROM campains Where campain='".$campain."'");
while ($row = mysql_fetch_array($result))
$credits = ($row["credits"]);
// check credits and set status
$limited = '4';
if ($credits > $limited){
mysql_query("UPDATE links SET status = '1' WHERE campain ='".$campain."'");
}
elseif ($credits < $limited){
mysql_query("UPDATE links SET status = '0' WHERE campain ='".$campain."'");
}
$id++;
//list links
// Edit this number to however many links you want displaying
$num_displayed1 = 500 ;
$result = mysql_query ("SELECT * FROM links WHERE status =1 LIMIT $num_displayed1");
while ($row = mysql_fetch_array($result))
echo '<center><font size="3">| <a href="java script:Popup(\'http://www.awc24h.com/ (...))">Click me-'.$row["linkid"].'</a> |</font></center>';
mysql_close($con);