I have the following code
$cat1;
if ($cat1){
my $cat1="%$category%";
}
else {
$cat1="$category";
}
$row=$dbh->prepare("SELECT contact_id,first_name,last_name,organisation
FROM tb_contacts WHERE (organisation ILIKE ? OR last_name ILIKE ?) OR
contact_id = ?");
$cat1;
print $cat1;
$row->bind_param(1,$cat1);
$row->bind_param(2,$cat1);
$row->bind_param(3,$cat1);
$row->execute();
this fails with
DBD::Pg::st execute failed: ERROR: invalid input syntax for integer:
"ford" at /home/www/cgi-bin/con_role_add_sel2_org.pl line 33., referer:
http://localhost/cgi-bin/con_role_add_sel1.pl
It only fails if I have both the name and int WHERE Criteria - in psql
it works fine
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>