CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
TMPL variable

 



altarek
New User

Jan 20, 2013, 12:55 AM

Post #1 of 7 (1907 views)
TMPL variable Can't Post

Hi

sorry I'm new and I want help

I have perl file and output will be at tmpl file

the problem, I can't have output at variable to display it using tmpl file

for example

Code
my $sth = $dbh->prepare("SELECT name from employee where empno= ?"); 

$sth->execute($empno->{empno});
my $emp= $sth->fetchrow;


the problem I can't have name at variable and display it at tmpl file

any help??


7stud
Enthusiast

Jan 20, 2013, 10:50 PM

Post #2 of 7 (1859 views)
Re: [altarek] TMPL variable [In reply to] Can't Post

If you know anyone that speaks English, tell them what you want to ask, and have them write the post


(This post was edited by 7stud on Jan 20, 2013, 10:51 PM)


rovf
Veteran

Jan 21, 2013, 2:08 AM

Post #3 of 7 (1852 views)
Re: [altarek] TMPL variable [In reply to] Can't Post

I also don't understand the question. Could you please rephrase it?


Laurent_R
Veteran / Moderator

Jan 21, 2013, 4:37 AM

Post #4 of 7 (1850 views)
Re: [rovf] TMPL variable [In reply to] Can't Post


In Reply To
I also don't understand the question.


Good to figure out I was not the only one. ;-)


altarek
New User

Jan 22, 2013, 2:22 AM

Post #5 of 7 (1821 views)
Re: [altarek] TMPL variable [In reply to] Can't Post

Sorry Frown

The problem I do not know how to get the output of the code in a variable
Then using this variable in the TMPL file
Example

my $sth = $dbh->prepare("SELECT name from employee where empno= ?"

I want to get [name] in a variable in order to use it in TMPL file


Is this good???
Wink


Rahul6990
Novice

Jan 22, 2013, 3:06 AM

Post #6 of 7 (1820 views)
Re: [altarek] TMPL variable [In reply to] Can't Post

This will work:


Code
$sth->execute(); 
my $name = $sth->fetchrow;

Wink


altarek
New User

Jan 23, 2013, 4:17 AM

Post #7 of 7 (1797 views)
Re: [altarek] TMPL variable [In reply to] Can't Post

Did not work

I'm trying to implement this code in Koha
Unfortunately I cannot get the outputs

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives