You are here: html_options « Smarty Templates Posts « IT news, forums, messages
html_options

Posted by Jm on 05/13/05 03:17

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 = "SELECT Job FROM t_jobinfo;";

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

TEMPLATE:

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

--
J

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация