Hey, Need a little help. Basically the following script should be checking the users credits and if they have more than 1, then display their link....But it doesn't. The script just takes forever to load. Then again I'm with Dreamhost and they're...well...awful.
PHP:
$o=0;
while ($o<1)
{
$res = mysql_query ("SELECT * FROM sites WHERE active='1' ORDER BY rand() LIMIT 1");
while ($row = mysql_fetch_array($res))
{
$id = $row['id'];
$member = $row['member'];
$url = stripslashes($row['url']);
}
$res = mysql_query ("SELECT * FROM users WHERE id='$member'");
while ($row = mysql_fetch_array($res))
{
$credits = $row['credits'];
}
if ($credits>=1) {$o = "1"; }
else {$o = "0"; }
}
$credits--;
$res = mysql_query ("UPDATE users SET credits='$credits' WHERE id='$member'");






