我想这应该很容易。我很新,正如你会在我草率的代码中看到的那样,但我无法让这个 for 循环在更大的 while 循环中工作。我收到一个解析错误,但我已经检查了数百次代码,但找不到丢失的分号或逗号。任何提示表示赞赏。
谢谢!
$result = mysql_query("SELECT `alias`, `max_seats` FROM `rsvp` WHERE `id` = '$id' ");
$alias = $r['alias'];
$seats = $r['max_seats'];
while($r = mysql_fetch_array($result)){
echo '<h3>Welcome, ' . $alias . '. Please complete your RSVP</h3>';
echo '<form class="register" method="post">';
echo '<input type="radio" id="responded" name="responded" value="1">Attending (confirm details in the next step)<br />';
echo '<input type="radio" id="responded" name="responded" value="0"><em><strong>NOT</strong></em> Attending (we\'re sorry you can\'t make it!)<br /><div class="hide" id="hide1">';
echo '<p>Please select the number of seats you\'d like to confirm (' . $seats . ' seats maximum)</p>';
echo '<label for="seats">Seats</label>';
echo '<select name="seats" id="seats">';
for ($i=1; i=$seats; $i++){
echo '<option value="' . $i . '">' . $i . '</option>';
}
echo '</select> <input type="text" placeholder="How many Chicken?"></input><br />';
echo '<input type="text" placeholder="How many Beef?"></input><br /></div>';
echo '<input type="reset" value="Clear"><input type="submit" value="Submit"></form>';