First I would try the DB query with hardcoded values - ignore the form inputs and make a query that you know will work and see what happens. When you have that working add some print statements - first to the $db_query that you construct from the form parameters to make sure it is what you think it is (examine it closely), and then the $total to make sure you are getting something back. And so on...
$db_query = "SELECT ST.sno_name,HT.homolog_name FROM sno_Table ST,
+Homolog_Table HT,sno_Homologs SH,Organism O
WHERE ST.sno_id=SH.sno_id AND SH.homolog_id=HT.homolog_id AND HT.org_i
+d=O.org_id and (ST.family=$family) and
O.organism='$TB'";
print "db_query: $db_query<br>"; # add this
my $sth = $dbh->prepare($db_query);
$sth->execute();
my $total = $sth->rows;
print "total rows: $total<br>"; # add this
Also, fix your td tags:
<td>$sno_name</d>
should be:
<td>$sno_name</td>
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.