Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

NXN array

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
Jomes
Smarty Rookie


Joined: 09 Jun 2004
Posts: 7
Location: VissticjCity

PostPosted: Mon Jun 28, 2004 1:28 pm    Post subject: NXN array Reply with quote

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


Joined: 09 Jun 2004
Posts: 7
Location: VissticjCity

PostPosted: Wed Jun 30, 2004 7:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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