Ik zit met het volgende ;
Op mijn site kan men een multidice game spelen. Echter, als je account dood of gebanned is dan gaat je sitestate ( toestand account ) van 0 naar 1 banned of 2 dood.
Alleen nu blijft de naam van de speler die er niet meer in mee kan doen in de array staan. in de database is dat dan eerst de naam van degene die het spel gestart heeft:
starter-speler1-speler2 etc
Dus stel speler1 kan en mag niet meer mee doen, hoe filter ik die er uit ?
Hoe het nu opgeroepen wordt is :
<?
$result = mysql_query("SELECT dice,dice_info,name,sitestate FROM login WHERE sitestate='0' ORDER BY name DESC") or die(mysql_error());
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
if(!empty($row['dice'])){
$mp_players = explode("-", $row['dice']);
$mp_players = array_unique($mp_players);
$info_dice = explode("-", $row['dice_info']);
?>
<tr>
<td width="175" align="left" class="sub"><b>Started by:</b></td>
<td width="75" align="left" class="sub"><b>Players:</b></td>
<td width="150" align="left" class="sub"><b>Current Pot:</b></td>
<td width="150" align="left" class="sub"><b>Entry Fee.</b></td>
</tr>
<tr>
<td width="175" align="left" class="cell" ><input name="dice" type="radio" value="<?php echo $row['name']; ?>" onfocus="if(this.blur)this.blur()"/>
<?php echo"<a href=\"view_profile.php?name=". $row['name']."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td>
<td width="75" align="left" class="cell"><?php echo count($mp_players); ?></td>
<td width="150" align="left" class="cell"><?php echo "$ ".number_format($info_dice[1] + ($info_dice[0] * count($mp_players))).",-"; ?></td>
<td width="150" align="left" class="cell"><?php echo "$ ".number_format($info_dice[0]).",-"; ?></td>
</tr>
<tr>
<td colspan="5" align="left" class="cell" ><b>Players:</b>
<?php
$i = 1;
foreach( $mp_players as $key => $value){
echo "<a href=\"view_profile.php?name=". $value."\" onFocus=\"if(this.blur)this.blur()\">".$value."</a>";
if($i != count($mp_players)) {
echo " - ";
}
$i++;
}
if($name == $row['name']){?>
|| <input name="Roll" type="submit" class="button" id="Roll" value="Roll." onfocus="if(this.blur)this.blur()" style="width: 50px;" /> ||
<?php }?></td>
</tr>
<?php }} // while
// end print out results received.
?>
Alvast bedankt voor eventuele reacties