in reply to Help my syntax
Don't do things like pat = \"" . $PatenteToQuery . "\" or strangers will ruin your databases for fun. Use the bind variables instead. It will save you trouble in terms of security and in terms of hunting down this bug.
my $sql = "SELECT * FROM final WHERE pat = ? and WHERE ped = ?"; my $sth = $dbh->prepare($sql); $sth->execute( $PatenteToQuery, $PedimentoToQuery );
In this case, your error was a missing end quote, which I found while installing the bind vars.
UPDATE: Yes, my mistake, I reproduced the bad SQL syntax while fixing the bad perl syntax. Honestly, I didn't even read the SQL. Sorry about that.
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help my syntax
by ArmandoG (Sexton) on Dec 21, 2007 at 20:14 UTC | |
by chromatic (Archbishop) on Dec 21, 2007 at 20:33 UTC |