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

Isnt working for me...

 
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
Outer_Regions
Smarty n00b


Joined: 13 Jul 2003
Posts: 2
Location: Texas, USA

PostPosted: Sun Jul 13, 2003 8:14 pm    Post subject: Isnt working for me... Reply with quote

I just got smarty and i have started on som e scripts for a new app.

But, when i tried smarty, it didnt seem to like me Sad


I included the files onto the pg, made a new smarty, assigned the data from the database into the template, and it didnt work, i tried several diff. ways....

index.tpl:
Code:

<html>
<head>
<title> HyperBB </title>
</head>
<body bgcolor="#FFFFFF">

{section name=main loop=$main_forums}
<h3> {$main_forums[main].main_name} </h3>
{/section}

</body>
</html>


index.php
Code:

<?php
   require("config.php");
   require_once("Smarty.class.php");

/*
make a new class
/*
   $PAGE = new Smarty;


$sql = mysql_query("SELECT * FROM hyperbb_main");

WHILE ( $row = mysql_fetch_array($sql)) {

 $PAGE->assign('main', $row);
}
 $PAGE->display('index.tpl');

?>


any help would be nice, ty Smile
_________________
PHP intermediate

Smarty Newbie
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Sun Jul 13, 2003 9:11 pm    Post subject: Reply with quote

Try
index.tpl:
Code:
<html>
<head>
<title>HyberBB</title>
</head>
<body bgcolor="#FFFFFF">
{foreach from=$main item=current}
<h3>{$current.main_name}</h3>
{/foreach}

index.php[php:1:361f99a983]<?php
require("config.php");
require_once("Smarty.class.php");
$PAGE = new Smarty;

$sql = mysql_query("SELECT * FROM hyperbb_main");
while($row = mysql_fetch_assoc($sql)) {
$main[] = $row;
}
$PAGE->assign('main', $main);
$PAGE->display('index.tpl');
?>[/php:1:361f99a983]
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
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