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
mike wrote:
> I have the following code
>
> $cat1;
> if ($cat1){
> my $cat1="%$category%";
The "my" here is scoped to this if { } block, so you aren't changing the
outer $cat1
> }
> else {
> $cat1="$category";
> }
>
> $row=$dbh->prepare("SELECT
> contact_id,first_name,last_name,organisation FRO
On Fri, 2005-02-11 at 08:02 -0500, Bob Showalter wrote:
> mike wrote:
> > I have the following code
> >
> > $cat1;
> > if ($cat1){
> > my $cat1="%$category%";
>
> The "my" here is scoped to this if { } block, so you aren't changing the
> outer $cat1
>
> > }
> > else {
> > $cat1="$category";
> >