Re: [htmltmpl] Select/option lists (how to generate)
Brought to you by:
samtregar
From: Philip T. <phi...@gm...> - 2005-01-10 19:15:02
|
Sometime on Jan 10, Mark A. Fuller assembled some asciibets to say: > # %db_vals is automatically populated because the prepared statement > # has "bind_col" each column to a $db_vals{key}. > > if ($db_vals{code} eq $selected_value) { > $sel = ' selected="selected"'; > } I do it by pushing the selected evaluation right to the SQL: SELECT foo, bar, baz, IF(bar='myval', 'selected', '') AS selected FROM ... and then just throw it into an arrayref. -- The days are all empty and the nights are unreal. |