Hi, I want to create a loop that reads out each of my page's menu_name from the database and on the same line that it reads it out, put a radio button to change the visibility. So far It looks like my radio buttons are on a different line and are all connected (instead of being checked "no" for all of them it is only check no on the last one of the entire sequence...
PHP Code://K's function: function get_all_pages() { global $connection; $query = "SELECT * FROM pages "; $query .= "WHERE visible = 1 "; $query .= "ORDER BY position ASC"; $page_set = mysql_query($query, $connection); confirm_query($page_set); return $page_set; } //K's function:function list_all_pages(){$output = "<ul>";$page_set = get_all_pages();while ($page = mysql_fetch_array($page_set)) {$output .= "<li><a href=\"add_feature.php?page=" . urlencode($page["id"]) . "\">{$page["menu_name"]}</a></li>";$output .= " <input type=\"radio\" name=\"visible\" value=\"0\" checked=\"checked\" /> No <input type=\"radio\" name=\"visible\" value=\"1\" /> Yes"; }$output .= "</ul>";return $output;}
pic1.jpg
Submit Your Article
Forum Rules

