Jump to content

select not retrieving all rows


flemingmike

Recommended Posts

hello, im only getting the second half of my results showing in my dropdown box.  here is my code.

 

if(isset($_GET['id']))
{
$uid = $_GET['id'];
}

$forward = mysql_query("SELECT * FROM players WHERE status = '1' AND position = 'forward' ORDER BY name");
$forward1="";
while($row1 = mysql_fetch_array($forward))
  {
$forwardid=$row1["id"];
$forwardname=$row1["name"];
$forwardteam=$row1["team"];
$forward1.="<OPTION TITLE=\"$forwardteam\" VALUE=\"$forwardid\">".$forwardname.'</option>';
  }

$result = mysql_query("SELECT * FROM picks WHERE uid = '$uid' AND pickid = 'forward1'");
while($row = mysql_fetch_array($result))
{
  $playerid=$row['playerid'];
}

if(isset($forwardpick1)) {
$result1 = mysql_query("SELECT * FROM players WHERE id = '$playerid'");
while($row1 = mysql_fetch_array($result1))
{
  $forwardpick1=$row1['name'];   
}
$forwardpick1="<br /><br /><font color ='#000000' size = '5'><b>$forwardpick1";
} else {
$forwardpick1="
<form method='POST' action='draftpick.php' name='forward1'>
<p><font color='#000000'><select size='1' name='player'>
<?php echo '$forward1'; ?>
</select><br><br><input type='submit' value='Submit' name='submit'></font></p>
</form>
";
}

 

any direction is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/247979-select-not-retrieving-all-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.