For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > May 2005 > html_options









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author html_options
Jm

2005-05-13, 4:17 pm

I'm trying to build a select/option list off of a database select.
I've confirmed that the correct data is coming out of the query. My
options are empty in the template though. This is my first attempt at
html_options. I'm doing something wrong, any help? TIA


PHP:

// Build job selector pulldown
$sql_job_pulldown =3D "SELECT Job FROM t_jobinfo;";

if($result =3D $mysqli->query($sql_job_pulldown))=20
{
// dump into a select statement
// fetch associative array
$smarty->assign('JOB_OPTION', $result);
$result->close();
}

TEMPLATE:

<td align=3D'center'>Job Name</td>
<td align=3D'center'>
<select name=3D'job_name'>
{html_options options=3D$JOB_OPTION}
</select>
</td>

--=20
J
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com