以下代码列出了用户可以接受的available matches
并将其硬币相互投注。在这个时刻,我一次只能列出一场比赛。
$query = mysql_query("SELECT `create_id` ,`value`, `player1`, `match_id` FROM `multiplayer` WHERE `complete` = 0 ORDER BY `value` DESC LIMIT 1");
echo '<table>';
while($rowtwo = mysql_fetch_array($query)){
$format_coins = number_format($rowtwo['value']);
$value = $rowtwo['value'];
$create_player = $rowtwo['player1'];
$echo = $rowtwo['match_id'];
$create_id = $rowtwo['create_id'];
$button = '
<form action="multiplayer.php" method="POST">
<input type="submit" name="'.$echo.'" value="Accept">
</form>
';
//$button = '<a href="match/'.$echo.'.php">Accept</a>';
echo '<tr>
<td><font size="2" face="Lucida Sans Unicode"><strong>'.$rowtwo['player1'].'</strong> has wagered '.$format_coins.'M/Gp'.$button.'</td>
</tr>';}
echo '</table>';
现在我需要将DESC LIMIT 1
更改为DESC LIMIT 10
左右,但是当我一次添加多个列表时,以下代码无法获取它。它只获得了所列出的一个。
if (isset($_POST[''.$echo.''])) {
if ($user_data['coins'] >= $value) {
if ($user_data['user_id'] == $create_id) {
echo 'You can\'t play yourself.';
} else {
我需要它,以便能够从该按钮中选择match_id
。如果我将按钮值设置为$echo
,它会选择匹配ID,但似乎我的问题出在我的isset($_POST[''.$echo.''])
任何人都可以帮忙吗?
答案 0 :(得分:0)
我通过添加
修复了这个问题if (isset($_POST[''.$echo.''])) {
进入列出可用matches
的while循环。