I am trying to perform a query that takes the string from a series of
checkboxes and returns rowes which have a field which contains all
these strings in any order.
This is the code i am using:
[perl tables="products"]
@array = split(/-/,$CGI->{from});
my $res = '';
$sql = "SELECT * FROM products WHERE icons LIKE '%'";
foreach(@array){
$sql .= " AND icons LIKE '%" . $_ . "%'";
}
$Tag->query({sql=>$sql,hashref=>'results',table=>'products'});
foreach my $row (@{$Tmp->{results}})
{
$res .= $row->{description} . "test<br>";
}
return $res;
[/perl]
This returns no string. I have changed the return to return the sql
string and then ran the same sql query in directsql and this returns
the correct products. Changing it back to return res brings back no
string.
This does not make any sense to me.
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.