I need help, using CGI, ODBC and Flash. I am trying to output the results from a CGI, which performs an SQL statement on an ODBC data source, in HTTP headers so that it can be used in a dynamic text box in a Flash file. I can get the results to appear when run from a DOS prompt, but cannot retrieve any details in a browser. Ideally, I would prefer each row of the query results to be in a separate header, but can you force a CGI to output a HTTP header? Please can you help?
#!usr/perl/bin use CGI; use DBI; $q = new CGI; $message_id = 0; $message_date = ""; $message_time = ""; $message_sender_name = ""; $message_to_name = ""; $error_message = "No Records Found...Please Select Again"; $department_type_local = $q->param(department_type); print "got to end of vars\n"; $dbh = DBI->connect("DBI:ODBC:messagestore", "anonymous", "password") +or die "Couldn't connect to database"; $query = $dbh->prepare("SELECT [message_table].message_id], [message_t +able].[message_date], [message_table].[message_time], [message_table] +.[message_sender_name], [message_table].[message_to_name], [message_t +able].[department_id] FROM message_table WHERE((([message_table].department_id]) = ?)); +"); $query->execute($department_type_local) or die "Couldn't execute state +ment"; open (flha, "message.html") or die "Can't open html doc.\n"; while (<flha>){ print; } close flha; open (messagelog, "messagelog.log") or die "Can't open temp log file.\ +n"; if ($query->rows == 0){ print $error_message; } else { while (@data = $query->fetchrow_array()){ $message_id = $data[0]; $message_date = $data[1]; $message_time = $data[2]; $message_sender_name = $data[3]; $message_to_name = $data[4]; } } close messagelog; $query->finish; $dbh->disconnect;

Edit: chipmunk 2001-05-02


In reply to Help combining CGI, ODBC, and Flash by grax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.