Link to home
Start Free TrialLog in
Avatar of alicca
aliccaFlag for Malaysia

asked on

PHP : how to assign variable from mysql to smarty

hi, i want to pull 1 column of data from mysql and put it into
smarty template that use

listmenu or html_option

 i have something like this

====================================================================================
$query = "SELECT * FROM package";
$query_result = @mysql_query ($query) OR error(mysql_error());
while ($info = @mysql_fetch_array($query_result))
{
      $types_temp = array();
      
      $types_temp = $info['pack_name'];

}

STemplate::assign('types_temp', $types_temp);
=================================================================================

TPL:
            <select name="package">
             <option value='null'>-- none --</option>
            {html_options options=$packnamez.sohai }
           </select>


does my TPL correct? i cant figure it work :(
some 1 please help
ASKER CERTIFIED SOLUTION
Avatar of hampus_b
hampus_b
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial