|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rreen Smarty n00b
Joined: 06 Nov 2003 Posts: 2 Location: Amsterdam, Netherlands
|
Posted: Thu Nov 06, 2003 9:08 pm Post subject: HTML_OPTIONS and data out of Oracle |
|
|
Hi There
I'm new to smarty and i've got a problem:
I have a oracle table with values, i extract the data from this table through oci8
after i want to sho the data in a select field.
code in the template:
<form action="{$aktie}" method="post" enctype="multipart/form-data" name="picup"
target="_self" id="picup">
<b>Producer/Studio:<br>
<select name=prod_id>
{html_options options=$producers selected=$prod_id1}
</select>
Code in the php-script:
while (OCIFetch($stmt))
{
$prid[]= OCIResult($stmt, "PROD_ID");
$prnaam[]= $row[OCIResult($stmt, "PROD_NAAM")];
}
OCILogoff($con);
$smarty->assign('producers', array(
$prid => $prnaam
));
$smarty->assign('prod_id1', $prid[0]);
But i can't see nothing, tried several things....
what is wrong here?
greetings
Richard |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Nov 07, 2003 9:56 am Post subject: |
|
|
$smarty->display('template.tpl');
I think the way you assign the producers array is incorrect. It has to be a normal associative array of name, value pairs. You seem to be setting a single key (which is actually an array) and a single value (also an array). |
|
Back to top |
|
rreen Smarty n00b
Joined: 06 Nov 2003 Posts: 2 Location: Amsterdam, Netherlands
|
Posted: Mon Nov 10, 2003 11:54 am Post subject: problem solved |
|
|
I've figured out that i was using the wrong oci-statement, it had to be ocifetchinto...this gave me as result a array. also had to change the template and the result is how i would expect it.
Greetings
Richard |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|