I have demo.php file and over there I created a function for fetching data from database:
Ex:
function display() {
$sql = "SELECT * FROM user WHERE id=" . $_POST['id'];
$r=mysql_query($sql);
$row=mysql_fetch_row($r);
}
Now, I have user.tpl file and I want to display the $row data coming from above display function into that .tpl file.
I am completely newbie in smarty and don’t have much idea about it also not aware with the syntax of it.
How can I achieve this.
Need help….thanks
For getting values in smarty template you need to use assign Method
and in your template file, you can use foreach function to loop through arrays