I am designing an interface to interact with a SQL Database. I am using the CGI module to recieve information passed by an html post (includes text boxes etc). eg
$client_name = $query->param('client_name'); chomp $client_name;
This is more of a design aspect question. I recieve these results in my perl script, then perform an SQL query using those parameters. I want this page to be a preview of the database results returned by the query.

$sql = "SELECT * FROM tblClient(NOLOCK)"; my $sth = $dbh->prepare( $sql ); $sth->execute; while ( my $result = $sth->fetchrow_hashref ) { if ($result->{Client_Name} =~ /$client_name/i){ print "$result->{Client_Name}"; print "$result->{Email}"; print "$result->{Address}"; print "$result->{Phone}"; print "$result->{Fax}"; # Count is used to store the number of matches $count++; }
This will all be nested within a table. For example:

------------------------------------------------------

Name | Address | Phone | Order Date | More info |

------------------------------------------------------

Frank | 2 Dunedin | 34243 | 11/02/2001 | click me |

------------------------------------------------------

.........

.........

I want to use the More info column to allow the client to click to view specific information regarding a given client. As i am using CGI i have thought about 2 methods. One: incapsulate each row within a <form> </form> and use the More info column as a "submit" button. If i use this method which could be completely wrong, will i have to use text boxes to display the data (There is no need for these values to be edited). The second method would involve storing the values returned by the database in a hash array. Could someone please point out to me the common technique for achieving my goal. I'm sure this has been done thousands of times before. I hope i managed to explain my problem.

Thankyou very much for your time

Digger

janitored by ybiC: Balanced <code> tags around codeblocks instead of HTML formatting markup


In reply to Database Search by Anonymous Monk

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.