|
I was populating a drop down list in a template with content from a table called "usapages," but wanted to have a more specific query that would limit the data grabbed from this table by the controller function. I was using the following line in my _new function in the controller: $page_id_options = $db->distinct_values( "usapages", "link" ); but I wanted to limit the values from the "usapages" table by using a custom MySQL query. So I replaced the above line with this: $page_id_options_x = mysql_query("SELECT page_id,menu_title from usapages WHERE level='1' and visibility='public'"); while ($result=mysql_fetch_array($page_id_options_x, MYSQL_NUM)) { $page_id_options[$result[0]] = $result[1]; } |