Re: [SMARTY] Very Basic Question: Database/PHP/Smarty
| From: | Monte Ohrt | Date: | Tue, 18 Feb 2003 21:31:31 +0000 |
| Subject: | Re: [SMARTY] Very Basic Question: Database/PHP/Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7852@lists.php.net to get a copy of this message | ||
Hi Alex,
If you look at the first example in the Smarty crash course, you can see
how data is assigned to the template. You would assign your database
data in the same fashion. There is also an example of looping over an
associative array of data. Assigning an associative array can be as easy
as:
$smarty->assing($mydata);
or
$smarty->assign('mydata',$mydata);
depending on how you want to access it in the template.
http://smarty.php.net/crashcourse.php
Hope that helps.
Monte
On Tue, 2003-02-18 at 15:03, Alex wrote:
> Howdy, I have started to look at Smarty as a real possibility for our
> corporate site but my limited experience with database retrieval is keeping
> me from understanding if Smarty will work as I think it will. I have done my
> best to find tutorials covering the use of databases (MySQL specifically)
> within Smarty but haven't found a great resource. Hopefully one of you can
> point me to a tutorial/example or explain to me how I would build a page
> utilizing information from a database.
>
> What I would like is a demonstration of the code to pull some fields (title,
> description, image) from MySQL via PHP and have them displayed on the page
> via Smarty.
>
> Thanks,
>
> Alex
--
Monte Ohrt <monte@ispi.net>