melaniecarr23 Posted September 21, 2011 Share Posted September 21, 2011 I am creating a form from a main table. Some of the fields in that table will be populated from information in another table (table2). On the form, I created a radio button with the value set to the ID of table2, and the text following that as the label. My problem is that I'd like the data to span several columns, say 5 items in the first column, 5 in the second, and the rest in the 3rd. Here is the code I used to populate the form: <tr><td>Select one:</td><td><?php do { ?><input name="mom_ed" type="radio" value="<?php echo $row_degree['degreeID']; ?>" /><?php echo $row_degree['degree']; ?><?php } while ($row_degree = mysql_fetch_assoc($degree)); ?></td></tr> Can someone help me figure out how to do this? Thanks! Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 21, 2011 Share Posted September 21, 2011 I have no idea what you are wanting. Give a visual example. Also, are you using two queries or one? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted September 21, 2011 Share Posted September 21, 2011 I'm not sure if this is what you mean, that explanation was more than confusing, but I'll give it a go: you want to pull out five records from your database and create a radio button for each??? $q = mysql_query("select `degreeID` from `table2` order by `degreeID` limit 5",$conn); while($r = mysql_fetch_assoc($q)){ echo '<input name="mom_ed" type="radio" value="'.$r['degreeID'].'"> '.$r['degreeID'].'<br />'; } ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.