after connecting to the database, and all... i get this error:
Parse error: parse error, unexpected T_DOUBLE_ARROW in /home/blazehit/blazehits-www/temp/trafficinput.php on line 23
Here is what the script looks like:
<?
$hostname = "localhost";
$username = "TEST1";
$password = "BLAT1";
$dbName = "blazehits_com";
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
//(example only, untested syntax)
$sql="select aid, user, url, credits, shown
from accounts
where shown<=credits
and account_status = 'approved'
";
while($result=mysql_query($sql, MYSQL_ASSO)){
if($result[shown]=>$result[credits]){
$ssql="update table accounts set
account_status = 'out_of_credits'
where aid = '$result[aid]'
";
mysql_query($ssql);
}else{
$ssql="update table accounts
set shown = shown+1
where aid = '$result[aid]'
";
mysql_query($ssql);
}
//use php to generate the links, HTML, etc. here
echo "<a href='$request[url]'>$request[user]</a><br>";
}
mysql_close();
?>