my $column = ( $type eq 'alpha' ) ? 'name' : "CONCAT_WS(' ',keywords,category)";It's just a compact way to write if (..) {} else {}. Look for Ternary "?:" in perlop.
my $query = "SELECT name, address, city, phone FROM valley ". "WHERE $column LIKE ? ORDER BY name LIMIT ?,?";The concept of Placeholders and Bind Values is fairly well described in the DBI documentation.
In reply to Re^5: Search 2 columns
by andreas1234567
in thread Search 2 columns
by JimJx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |