in reply to MySQL pattern matching
As well, your SQL regular expression is also wrong. When doing regular expressions in SQL, you want to use LIKE (for mySQL and SQL Server I believe at least)my $csr = $dbh->sqlSelectMany("*", "company_contact_info", "region='S +an Diego'"); while(my $row = $csr->fetchrow_hashref()) { #row is now a single returned row that matched your query; }
Without LIKE, it won't interpret the string as a regular expression, and thus will be searching for "\%San Diego\%"SELECT * FROM company_contact_info WHERE REGION LIKE "%San Diego%"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: MySQL pattern matching
by cdherold (Monk) on Feb 24, 2002 at 19:42 UTC |