vertigos Posted January 2, 2009 Share Posted January 2, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 2, 2009 Share Posted January 2, 2009 you are assigning an empty or NULL variable ($id) try changing the last line to $smarty->assign ('affiliateid', $data['id']); 0 Quote Link to comment Share on other sites More sharing options...
vertigos Posted January 2, 2009 Author Share Posted January 2, 2009 Oh. I never thought about that. Anyway And why $clientsdetails.firstname is allready assigned ? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 2, 2009 Share Posted January 2, 2009 $clientsdetails.firstname is assigned when a user logs in 0 Quote Link to comment Share on other sites More sharing options...
vertigos Posted January 2, 2009 Author Share Posted January 2, 2009 if i run {debug} at login.php it will show me which are assigned when a user is logged in? Where can i see that? Ty very much for the help sparky. And for the help you've given to whmcs also 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 2, 2009 Share Posted January 2, 2009 how are you putting the debug smarty tag into an encoded php file? Don't you mean login.tpl place the {debug} tag into any of the tpl files and a popup window will show with the assigned variables (so long as you arn't using a popup blocker) 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.