logo       
Google Custom Search
    AddThis Social Bookmark Button

Using DBIx::XHTML_Table: msg#00037

Subject: Using DBIx::XHTML_Table
My meager Perl skills are probably killing me on this one. I am trying to
use the module in question to get info out of a database nicely format it
and then plaster it into my html page.

sub open_tickets {
    my $self = shift;

    # The message
    my $page_header = 'Open Tickets';

    # Open the desired template
    my $template = $self->load_tmpl('open.tmpl', cache => 1);

    # Connect
    my $table_db = DBIx::XHTML_Table->new('dbi:Oracle:dbname', 'user',
'pass',
        { RaiseError => 1, }
    );

    # SQL query to get all open tickets
    $table_db->exec_query("
        select *
        from users
    ");

    my $table_data = $table_db->output();   # this is probably it, though I
am not sure.

    $table_db->disconnect;

    # Fill in params
    $template->param(
        page_header => $page_header,
        page_data => $table_data,
    );

    # Parse the template
    my $html_output = $template->output;
    return $html_output;
}


I have "strict" and "warnings" on and no errors are generated.

Robert




---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>