Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.