Jump to content

Trying to understand Smarty


vertigos

Recommended Posts

Hi there.

As you can see i'm new to smarty and never before wanted to learn.

But as i want to create a new page, i have to learn.

So i've read a lot about at smarty.net but still can't understand how to compile smarty with db.

I'm trying this in php

$query = 'SELECT * FROM tblaffiliates WHERE clientid=\'' . $_SESSION['uid'] . '\'';   
    $result = mysql_query ($query);
   $data = mysql_fetch_array ($result);

$smarty->assign ('affiliateid', $id);

 

and this in tpl file

Sorry {$clientsdetails.firstname} !!  This is you {$affiliateid}

 

It understands clientsdetails.firstname without have it assigned in php but affiliate id doesn't recognise it.

What am i doing wrong??

 

This is just a sample btw

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated