Hey,
I'm having some problem with some code that I am trying to write. I am setting up a checkout for my school's bookstore (over an intranet), and I need to be able to have several dropdown boxes with the names of books. I have some code that actually creates the number of dropdown boxes, but it only populates the first dropdown list. However, I need it to put the names of the books in all of the dropdown lists. The code is as follows:
<snip>
for($i=$num_books; $i>=0; $i--){
$number = 1;
echo " <tr> ";
echo " <td width='50%'>Book# $number: <select name='checkout_book'>\n";
echo " <option>Select A Book</option>\n";
while($books = mysql_fetch_array($books_result, MYSQL_ASSOC)){
$book_id = $books['book_id'];
$title = $books['title'];
echo " <option value=$book_id>$title</option>\n";;
}
echo " </select></td>\n";
$number++;
}
</snip>
I am pretty sure that the while statement is only running through one time, however I'm not exactly sure how to fix it. Any suggestions?