separate page for each database row
| From: | mbatch spm | Date: | Tue, 25 Mar 2003 06:55:06 +0000 |
| Subject: | separate page for each database row | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8878@lists.php.net to get a copy of this message | ||
The following outputs my 1254 rows from MySQL table into one html page.
I'd like to have EACH row build its OWN page.
suggestions?
obliged.
+++++++++++
from my index.php
----------------
$query = ("SELECT * from e_xoops_dealerX_cardealers");
$result = mysql_query($query) or die("Oh no!");
while ($row=mysql_fetch_row($result)){
$tablerows[] =$row;
}
// Assign the array with the values from the
// database to the template
$template->assign("tablerows",$tablerows);
// Print template
$template->display("/templates/dealerx3.tpl");
--------------
from my template.tpl
=========
<table border=1>
{section name=outer loop=$tablerows}
<tr>
{section name=inner loop=$tablerows[outer]}
<td>{$tablerows[outer][inner]}</td>
{/section}
</tr>
{/section}
========
---------------------------------
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!