|
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 |
lesmith Smarty Rookie
Joined: 19 Sep 2003 Posts: 34
|
Posted: Fri Sep 26, 2003 8:23 am Post subject: output result in template |
|
|
Hopefully another simple question
I have a simple request and cant seem to output in the template. Code as follows
php file
include_once "/vhosts/boxedunique.co.uk/ez_sql.php";
$boxdata = $db->get_row("SELECT * FROM boxes where id = '1'");
$tpl->assign("boxdata", $boxdata);
$tpl->displayTemplate();
So $boxdata is now a object.
in the template I have not used section due to it only being one pice of data. So I have tried these and others but with no outcome.
<input type="text" name="box_name" size="20" value="{$boxdata.box_name}" /></td>
<input type="text" name="box_name" size="20" value="{$boxdata.[box_name]}" /></td>
<input type="text" name="box_name" size="20" value="{$boxdata[].box_name}" /></td>
Can anyone help with this hopefully simple question. And before you ask does $boxdata contain anything it does. I have just put in $print_r($boxdata) in the php page to test it it contains anything and it does ie the output from print is this
stdClass Object ( [id] => 1 [box_name] => Name [box_description] => description [box_id] =>ABC123 [box_price] => 1000.00 [page_success] => success [page_cancel] => cancel [box_category] => formen [box_image] => mgb01 )
Lee |
|
Back to top |
|
Troublegum Smarty Rookie
Joined: 07 Sep 2003 Posts: 33 Location: Germany
|
|
Back to top |
|
lesmith Smarty Rookie
Joined: 19 Sep 2003 Posts: 34
|
Posted: Fri Sep 26, 2003 12:57 pm Post subject: |
|
|
Sweet
Thankyou Troublegum
|
|
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
|