|
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 |
Jomes Smarty Rookie
Joined: 09 Jun 2004 Posts: 7 Location: VissticjCity
|
Posted: Mon Jun 28, 2004 1:28 pm Post subject: NXN array |
|
|
Hello,
When I retrieve information out of my database. there can 1 or more results.
When I want to print them on my screen Smarty only prints tthe first item retrieved. The next one is empty.
Below is my code:
index.php
------------------------
<?php
require 'libs/Smarty.class.php';
include "connect.php";
$smarty = new Smarty;
$query = "SELECT * FROM articles";
$articles = mssql_query($query);
$article = mssql_fetch_array($articles);
$smarty->assign("article", $article);
$smarty->display('evotemplate.htm');
?>
In the template I include the file page.htm
code of page.htm:
--------------------------
{* <html>
<body>*}
{section name=articles loop=$article}
articlemanufacturer={$article[articles]}
{/section}
{*</body>
</html>*}
The result is:
articlemanufacturer=Compaq articlemanufacturer=102 articlemanufacturer=dag articlemanufacturer=hoihoihoi articlemanufacturer=12.00 articlemanufacturer=0 articlemanufacturer=1 articlemanufacturer=http:// articlemanufacturer=http:// articlemanufacturer=http:// articlemanufacturer=3 articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer= articlemanufacturer=
What am I doing wrong?
Kind regards.
Jomes _________________ "Say 'what' again! Say 'what' again! I dare you! I double dare" |
|
Back to top |
|
Jomes Smarty Rookie
Joined: 09 Jun 2004 Posts: 7 Location: VissticjCity
|
Posted: Wed Jun 30, 2004 7:49 am Post subject: |
|
|
This post can be locked
The problem is solved!
Greetz Jomes _________________ "Say 'what' again! Say 'what' again! I dare you! I double dare" |
|
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
|