Re: Noobie question

2001-06-14 Thread Michael D . Risser

On Thursday 14 June 2001 08:04 am, you wrote:
> OK I give up
>
> TMTOWTDI?
>

There's More Than One Way To Do It



Re: Noobie question

2001-06-13 Thread Michael D . Risser

At least we were a little more friendly about it, as well as point to some 
resources that would be more help in the long run. And let's not forget 
TMTOWTDI.

--SNIP--
> Fucking typical.
--SNIP--
> I hope this answer is more useful than that suggested by the others.



Re: Noobie question

2001-06-13 Thread Chuck Ivy


On Wednesday, June 13, 2001, at 12:05 PM, Ward, Stefan wrote:

> Does anyone have an example of a way to write a perl script that will 
> go out
> hit a data base table, pull in a column for that table and use that 
> column
> in a dropdown list?  I know what to do once I get that variable 
> selected by
> RTFriendlyM, but couldn't find a clear example of this.
>

Gee, you get three responses with books to read, or URLs to visit, but 
nobody actually answering your question.

Fucking typical.

Excuse me.

Ok.

So you've read the manual, and you're doing your SELECT from the 
database. In many cases, I find myself getting both a value and a human 
readable text for my dropdown.

For sake of argument, let's say your dropdown was a list of web pages, 
and the VALUE for each  is the URL of the page.

So my statements might go something like...

my $sql = "SELECT URL, Name
FROM Links
ORDER BY Name";
my $sth = $dbh->prepare($sql) or die ("Cannot prepare query $sql");
my $sth->execute or die ("Cannot execute query $sql");
my @fields = '';
my $selectstatement = "";
while (@fields = $sth->fetchrow_array) {
$selectstatement .= "$fields[1]";
}
$selectstatement .= "";


I hope this answer is more useful than that suggested by the others.



Re: Noobie question

2001-06-13 Thread Evgeny Goldin (aka Genie)


This should help :

http://dbi.symbolstone.org/
http://search.cpan.org/doc/TIMB/DBI-1.18/DBI.pm





Re: Noobie question

2001-06-13 Thread Michael D . Risser

On Wednesday 13 June 2001 12:22 pm, Peter Scott wrote:
> At 12:05 PM 6/13/01 -0700, Ward, Stefan wrote:
> >Does anyone have an example of a way to write a perl script that will go
> > out hit a data base table, pull in a column for that table and use that
> > column in a dropdown list?  I know what to do once I get that variable
> > selected by RTFriendlyM, but couldn't find a clear example of this.
>
> A good book in this respect is "Writing CGI Application with Perl",
> http://www.amazon.com/exec/obidos/ASIN/0201710145.  Many examples.

You may also want to try "Programming the Perl DBI" by Alligator Descartes & 
Tim Bunce published by O'Reilly

> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com



Re: Noobie question

2001-06-13 Thread Peter Scott

At 12:05 PM 6/13/01 -0700, Ward, Stefan wrote:
>Does anyone have an example of a way to write a perl script that will go out
>hit a data base table, pull in a column for that table and use that column
>in a dropdown list?  I know what to do once I get that variable selected by
>RTFriendlyM, but couldn't find a clear example of this.

A good book in this respect is "Writing CGI Application with Perl", 
http://www.amazon.com/exec/obidos/ASIN/0201710145.  Many examples.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com