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.h tml.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.
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.h
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.
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("sel ect * from tblsubleftmenu where fldcid=".$fldid." and fldlangid=".$_SESSION['Fld LanguageId ']);
$ttrsrow=$trs->fetchRow();
extract($trsrow);
If I say print_r($trsrow), it displays the record
but I think
$this->smarty->assign("lef t",$$trsro w);
is not working........
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("sel
$ttrsrow=$trs->fetchRow();
extract($trsrow);
If I say print_r($trsrow), it displays the record
but I think
$this->smarty->assign("lef
is not working........
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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("lef t",$$trsro w);
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)
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("lef
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)
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.