10-23-2007, 08:56 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Sep 2007
Posts: 89
Thanks: 1
|
Help! Trying to template something here. :)
Hey guys. I'm aving trouble templating a while statement. See the code below.
PHP Code:
<?php
/**
* @author Sam Granger
* @copyright 2007
*/
defined('parent') or die('Direct access to this file is not allowed!');
$interface = new Interface('array');
$interface->title = "News";
$interface->keywords = "News";
$database = new MySQL();
$connection = $database->Connect($DB_SERVER, $DB_USER, $DB_PWD, $DB_NAME);
$sql = "SELECT id, title, DATE_FORMAT(published,'%d-%m-%Y') AS published FROM news";
$query = $database->Query($sql);
while($array = $database->FetchArray($query)){
extract($array);
echo "<p>$id, $title, $published</p>";
}
$interface->content = "while content should really go here!";
$interface->Display();
?>
Ok, I want $interface->content to equal all the rows outputted by the while statement.
How can I do this? Looking forward to suggestions. Template system basically replaces a tag in a file with the content that I want.
|
|
|
|