perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Schilling <rschill...@nationalinformatics.net>
Subject strange Embperl behavior with INPUT tags when using DBI
Date Tue, 27 May 2003 08:26:11 GMT
Didn't see this one in the archives, so I thought I would mention it . 
. .


I'm using INPUT tags, in a way the documentation suggests Embperl will 
automatically insert values into the VALUE element:

	<FORM ACTION="details.epl" METHOD="POST">
		[# Embperl should insert the VALUE element in the field 
#]
		<INPUT TYPE="HIDDEN" NAME="Price">
		<INPUT TYPE="SUBMIT" VALUE="details">
	</FORM>

$fdat{'Price'} is defined for this form (e.g. defined($fdat{'Price'}) 
is true).

At the top of the page details.epl I have the following code 
($fdat{'Price'}=0 for this form):

	[-	$dbh = DBI->connect(" blah blah blah");
		$query = $dbh->prepare("SELECT COUNT(*) FROM pricetable 
where price >= $fdat{'Price'};");
		$query->execute or die "Couldn't run query.";
	-]


The execute statement dies because the SQL server reports a syntax 
error with the query.  Here's the output from the SQL log (the actual 
statement submitted to the server by Embperl):

	SELECT COUNT(*) FROM pricetable where price >= 0    0;

So, looks like Embperl inserts an extra value into $fdat somewhere?

Not sure what's happening here.  But when I specify the INPUT fields 
like this:

	<INPUT TYPE="HIDDEN" NAME="Price" VALUE="[+ $fdat{'Price'} +]">

I don't get the error.

Any clues?

--Richard Schilling

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message