The problem is, where the WHILE statement is, it should list all moves in the database that have a playerid of 2 and position of Strike.
There are two moves in the database that meet this criteria, they are:
-Punch
-Kick
When I execute the code, I choose Strike and a table is displayed, but only shows "Punch" which works fine, but doesn't display Kick. Its like the while loop is terminating, but its condition is still true. Can anyone see the problem?
Code: Select all
if (isset($_POST['submit']))
{
$byPass = 1;
$position = $_POST['position'];
$moveList="SELECT * from playermoves where playerid='$pid' and position='$position'";
$moveList2=mysql_query($moveList) or die("could not select any moves.");
print "<table border='1' bordercolor='#000000'>";
print "<center><tr><td>Move</td><td>Minimum Damage</td><td>Maximum Damage</td><td>Position</td><td>Resulting Position</td></tr> </center>";
while($moveList3=mysql_fetch_array($moveList2))
{
print "<tr><td>$moveList3[move]</td><td>$moveList3[mindam]</td><td>$moveList3[maxdam]</td><td>$moveList3[position]</td><td>$moveList3[resultposition]</td><td><a href='createmovecombo.php?latestMove=$moveList3[move]&position=$moveList3[resultposition]>Learn Move</a></td></tr>";
}
print "</table>";
}