Link to home
Start Free TrialLog in
Avatar of Desire2change
Desire2change

asked on

SMARTY - DISPLAYING NOTHING FROM THE DATABASE !

Hi

I have used smarty both on LINUX hosting and my own WINDOWS PC.
There is no problems with that.

But I have problems when I use it on WINDOWS hosting.

I have no idea how to fixed it, I search on google, and has browse
this forum with no luck.

Here is my situation :
1. I think I set all permision to templates_c and cache correctly
2. When page is display, I can see that SMARTY is able to write to
my templates_c directory,
but SMARTY can't read or write to those files.
I got warning PERMISION DENIED, and
nothing is display - just a blank page.

3. Also I notice that on my templates_c folder, besides
%%1A^1AB^1AB9BADF%%XXXXX.html.php file also
XXXXX.tmp
and SMARTY keep adding new XXXX.tmp file everytime display function is called.

Since I am only user, and has no capability to change the server environtment, what else can I do to make it works?

Thanks in advance for your kind help.
The database connection is ok. When I print array values it prints correctly.

Avatar of arrkerr1024
arrkerr1024
Flag of United States of America image

Well the user that the web server runs as need to have full access to the templaces_c and cache directories.  That user may be something strange in a shared hosting environment.  Do you know for sure which user it is (in a dedicated it would probably be either apache or nobody)?  Can you check the permissions again on those directories and post them?

Where do you see the permission denied message, on the screen on in the log?  Check the apache error log for errors if you haven't - there may be more useful information there.  Can you post the last few lines?

I'd tell you to make sure that your paths have changed from a windows format to unix format but I think you'd be getting "not found" messages instead of "access denied" if that was the case - but worth double-checking, it may be trying to write somewhere you aren't expecting.
Avatar of Desire2change
Desire2change

ASKER

I have changed the permission thru ftp to 777 for cache and templates_c folders
Also i checked all the folder paths all are ok.
No error messages are displaying.
the structure comes, it is multilingual so I use a function 'getlabel' which fetches labels from the db, the labels are also displaying, but other records are not displaying.

For example:
$trs=$this->db->query("select * from tblsubleftmenu where fldcid=".$fldid." and fldlangid=".$_SESSION['FldLanguageId']);
$ttrsrow=$trs->fetchRow();
extract($trsrow);
If I say print_r($trsrow), it displays the record
but I think
            $this->smarty->assign("left",$$trsrow);
is not working........


ASKER CERTIFIED SOLUTION
Avatar of Bernard Savonet
Bernard Savonet
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

1 - Where do you stand on the issue?

2 - Looking back at the ill-functioning code
a -$ttrsrow=$trs->fetchRow();
b - extract($trsrow);
c - echo "this works"; print_r($trsrow);
d -            $this->smarty->assign("left",$$trsrow);
I have some slight questions which may simply result from pasting errors here:
line a: I presume this is $trsrow= (as in line b and c)
line d: your code here says '$$trsrow', which probably does not work

Other possible problem: are you sure that $this->smarty is correctly predefined? Depending on the code, not sure what exactly is covered by $this-> and maybe $this->smarty is not what expected

Assuming this is correct, you should check on how in your TPL template, you use the array 'left'?
I suggest that after this line d, or just before the call to smarty->display, you add the line

$smarty->debugging = true;
when you will call the "normal" smarty display, it will also pop-up a javascript windows which displays ALL the content of smarty variables (whether they are used or not in your template)