katarra Posted March 18, 2010 Share Posted March 18, 2010 For some reason, when I run this script, the wep_list is pulling up blank when I know there are items in there. Can someone take a look at it and see what I might be doing wrong? Thanks! $inputs = '<input type="hidden" name="name" value="'.$_POST['name'].'">'; $inputs .= '<input type="hidden" name="barter" value="'.$_POST['barter'].'">'; $inputs .= '<input type="hidden" name="heal" value="'.$_POST['heal'].'">'; $inputs .= '<input type="hidden" name="heal" value="'.$_POST['move_around'].'">'; $result = $db->execute("select * from `items` where `type`='weapon'") or die("query failed: ".mysql_error()); $wep_list = ''; while($row = $result->fetchrow()); { $wep_list .= "<tr><td>$row[name]</td><td>$row[price]</td><td><input type=checkbox name=wep_$row[id]></td></tr>"; } // display a successful message $page = makepage('npc_weapons', '', 0); $page = str_replace('{wep_list}', $wep_list, $page); $page = str_replace('{inputs}', $inputs, $page); echo $page; [\php] Link to comment https://forums.phpfreaks.com/topic/195744-list-pulling-up-blank/ Share on other sites More sharing options...
The Little Guy Posted March 19, 2010 Share Posted March 19, 2010 remove the semi-colon on this line: while($row = $result->fetchrow()); Link to comment https://forums.phpfreaks.com/topic/195744-list-pulling-up-blank/#findComment-1028400 Share on other sites More sharing options...
katarra Posted March 19, 2010 Author Share Posted March 19, 2010 Fantastic! Thanks! Link to comment https://forums.phpfreaks.com/topic/195744-list-pulling-up-blank/#findComment-1028522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.