CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Limited number of MySQL queries?

 



ebelaski
Deleted

Feb 14, 2001, 6:49 AM

Post #1 of 1 (205 views)
Limited number of MySQL queries? Can't Post

I'm posting this because I'm out of ideas and this may be a long shot. I have one script with three forms (only one form can be displayed. Everything is in subs. the forms have a lot of <select> boxes populated from lookup tables in Mysql. It seems if I try to add one more query anywhere in the script, the page will not render, but it does compile fine. If I comment the query out then everything works fine.
Here is a standard call to a lookup table:
my $qstate = qq{SELECT VALUE FROM LUT_STATE ORDER BY VALUE};
my $sth = $dbh->prepare($qstate) || &db_error($error, $dbh->errstr);
my $rv = $sth->execute || die "cant execute the query";
print "<select name='STATE' size='1'>\n";
print "<option selected value='CO'>CO\n";
while(my @result = $sth->fetchrow_array) {
print "<option>@result[0]\n";
}
print "</select></td>\n";

this is a standard call to insert the form data:

my $contactupd = qq(INSERT INTO CONTACTS VALUES (0,'$CONTACTFNAME','$CONTACTLNAME','N',
'$ADDRESS1','$ADDRESS2',NULL,'$STATE','$ZIP','$AREACODE','$PHONE','$EMAIL',NULL));

my $error ="<h2>Database Error</h2> <p>Please try again later.<p>We apologize for the inconvience\n";

my $sth = $dbh->do($contactupd) || &db_error($error, $dbh->errstr);
$sth->finish;

I make only one connection to the DB.

any suggestions for things to check?

thank you,

eric


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives