rendered paste body<?php $con = mysql_connect(my info); mysql_select_db("facebook"); $new = mysql_query("SELECT name,small_image,num from pokes ORDER BY num DESC LIMIT 30"); while($row = mysql_fetch_array($new)) { $name = $row['name']; $num = $row['num']; echo "$num $name <br />"; $img = null; if ($row['small_image'] != null) { $img = $row['small_image']; } echo '<div style="float: left; margin: 0px; padding: 0px; width: 187px;"> <div style="float: left; margin-right: 5px; padding: 0px;"> <input id="action_'.$num.'" type="radio" value="'.$num.'" name="action_id" /> </div> <div style="float: left; height: 25px; margin-bottom: 2px; overflow: hidden; padding: 0px; text-align: left; width: 155px;"> '. if ($img != null) { '<label for="action_'.$num.'"><img src="http://d9c602a2.fb.joyent.us/gamerpoke/images/'.$img.'" /></label>' } .' <label style="font-weight: normal;" for="action_'.$num.'">'.htmlentities($name).'"</label> </div> </div>'; }?>