|
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 |
mdelsaut Smarty n00b
Joined: 16 Jul 2003 Posts: 2 Location: Rennes - France
|
Posted: Wed Jul 16, 2003 8:27 am Post subject: Send a query to a template |
|
|
Hello!
I'm beginner with Smarty and i want to know if is it possible to send a result of query directly in a template (and no use a array).
Like:
script :
$sql="SELECT * FROM table"
$sql_result=mysql_query($sql);
$index->assign('content', $sql_result);
tpl:
{foreach item="curr_section" from=$content}
<table>
<tr>
<td>{$curr_section.id}>/td>
</tr>
</table>
{/foreach}
Thank you! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Jul 16, 2003 10:20 am Post subject: |
|
|
short answer: no thats not possible. use an array.
longer answer: with many tricks and hacks this may be possible, but it is highly disencouraged. use an array.
|
|
Back to top |
|
mdelsaut Smarty n00b
Joined: 16 Jul 2003 Posts: 2 Location: Rennes - France
|
Posted: Wed Jul 16, 2003 12:33 pm Post subject: |
|
|
ok
it is well what seemed to me!
thank you nevertheless |
|
Back to top |
|
DeyV Smarty Rookie
Joined: 01 Jul 2003 Posts: 6 Location: Poland
|
Posted: Sat Aug 16, 2003 3:40 pm Post subject: |
|
|
You can use ADoDB |
|
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
|