Re: show databasetable
| From: | Monte Ohrt | Date: | Fri, 16 Mar 2001 14:14:03 +0000 |
| Subject: | Re: show databasetable | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-395@lists.php.net to get a copy of this message | ||
On a side note, you could make this a bit more efficient:
$result = mysql_query("SELECT * FROM foo");
while ($record = mysql_fetch_array($result) {
$smarty->append($record);
}
Hojtsy Gabor wrote:
>
> > How do I show database-content with Smarty?
>
> use:
>
> $result = mysql_query("SELECT * FROM foo");
> while ($record = mysql_fetch_array($result) {
> $rows[] = $record;
> }
> $smarty->assign("customer", $rows);
>
> And then see the 5-20. example in the manual...
>
> Goba
> ........................................................... . . . . .
> Editor of the Hungarian PHP manual, Admin of the Hungarian PHP mirror
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/