Smarty MySQL Tutorials


 

Smarty MySQL Tutorials

In this tutorial I will show you how to develop and good application using smarty template.

In this tutorial I will show you how to develop and good application using smarty template.

This tutorial will show you how to use mysql in php code and then use the smarty template to display the result to the user.

Smarty is the template engine for the PHP and it supports caching. It provides good performance and can be used to develop application of any size. Its performance is also very good as it supports caching also.

This tutorials is and step by step guide to develop the application using PHP, Smarty and MySQL. We will be using wamp on windows machine to test the application. But you can use linux, solaris or Mac OS to develop and test your applications.

Our application is simple news display application that displays the news from news table. We have separated the display logic with the data access logic.

You can download the source code of this tutorial from here. It includes the smarty template also in the zip file. To run the example copy and extract it on the wamp server. Create database and table and then change the MySqL connection varibales  in the news.php. After that you can test the news application.

Let's get started with the Smarty MySQL Tutorial:

1.Setting up the development environment
2.Creating Database table and populating it with sample news
3.Writing the php code (news.php) to retrieve the data
4.Writing the template file (news.tpl) to display the news
5.Writing css file to display the news
6.Running and testing the code.

Ads