Jump to content

[SOLVED] Do...While


zackcez

Recommended Posts

Here's my code:

$i = '0';
$q = mysql_query("SELECT * FROM user ORDER BY ".$skill."xp DESC");  
$row = mysql_fetch_array($q);
$e = getExclude($row['usergroupid']);
do {
	if ($e == '1') {
		$i++;
	} else {
		$pre       = getPre($row['usergroupid']);
		$suf       = getSuf($row['usergroupid']);
		$usernamer = $pre."".$row['username']."".$suf;
		echo"<tr><td class=\"alt1\" align=\"center\" nowrap=\"nowrap\">"; // "Layout"
		echo"<img src=\"http://rshelp.net/modules/highscores/icons/".$skill.".gif\"></td>"; //Image
		echo"<td class=\"alt1\" nowrap=\"nowrap\"><a href=\"index.php?pageid=highscores&action=user&user=" . $row['username'] . "\">$usernamer</a> (" . $row[''.$skill.'lvl'] . ")</td></tr>"; //User Info
	}
} while ($i>0); //LINE 77

Everything is defined....it just sits for the max time and stops :(....

Fatal error: Maximum execution time of 30 seconds exceeded in myfile.php on line 77

Link to comment
https://forums.phpfreaks.com/topic/117876-solved-dowhile/
Share on other sites

I'm attempting to make it search through the database to get one result, the user with the highest value that also has $e of 0....

Also here would be the function:

function getExclude($id) {
$excludeQuery  = mysql_query("SELECT * FROM usergroup WHERE usergroupid='$id'");
$excludeData   = mysql_fetch_array($excludeQuery);
switch ($excludeData['highscores_perms']) {
	case 2:
		$exclude = 1;
	break;
	case 3:
		$exclude = 1;
	break;
	default:
		$exclude = 0;
	break;
}
return $exclude;
}

Link to comment
https://forums.phpfreaks.com/topic/117876-solved-dowhile/#findComment-606318
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.