Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

HTML_OPTIONS and data out of Oracle

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
rreen
Smarty n00b


Joined: 06 Nov 2003
Posts: 2
Location: Amsterdam, Netherlands

PostPosted: Thu Nov 06, 2003 9:08 pm    Post subject: HTML_OPTIONS and data out of Oracle Reply with quote

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
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Nov 07, 2003 9:56 am    Post subject: Reply with quote

$smarty->display('template.tpl'); Smile

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
View user's profile Send private message
rreen
Smarty n00b


Joined: 06 Nov 2003
Posts: 2
Location: Amsterdam, Netherlands

PostPosted: Mon Nov 10, 2003 11:54 am    Post subject: problem solved Reply with quote

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 Laughing
Richard
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP