RE: CGI/DBI - Can anyone work out why this fails

2005-02-14 Thread mike
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; }

CGI/DBI - Can anyone work out why this fails

2005-02-11 Thread mike
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;

RE: CGI/DBI - Can anyone work out why this fails

2005-02-11 Thread Bob Showalter
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 FROM tb_contacts