Subject | Re: php case insensitive field access |
---|---|
Author | jackdmason |
Post date | 2013-01-25T20:58:41Z |
This solution will not work. Both InterBase and Firebird allow case insensitive searches, as does MySQL. The php interface should allow that option to be used as part of a query.
You cannot just capitalize the first and last name and accomplish anything. "McGrath" would not be found, nor would "van Duran", "MacDougal", etc., nor can you catch instances where a name has been entered incorrectly, such as Mcgee, variant spellings, etc.
At present we have to have our web server call a store server to process InterBase accesses because of this very reason; not only with names, but with book titles, authors (may or may not a name or company), etc.
We just need the php interface, at least for Firebird, to be fixed so we can do case insensitive searches. Delphi can do it, C++ can do it. Why cannot php do it?
You cannot just capitalize the first and last name and accomplish anything. "McGrath" would not be found, nor would "van Duran", "MacDougal", etc., nor can you catch instances where a name has been entered incorrectly, such as Mcgee, variant spellings, etc.
At present we have to have our web server call a store server to process InterBase accesses because of this very reason; not only with names, but with book titles, authors (may or may not a name or company), etc.
We just need the php interface, at least for Firebird, to be fixed so we can do case insensitive searches. Delphi can do it, C++ can do it. Why cannot php do it?
--- In firebird-php@yahoogroups.com, "slobtrot" wrote:
>
> Here's an example:
>
> $sql = "SELECT * FROM CUST WHERE LASTNAME LIKE upper(?) AND FIRSTNAME LIKE upper(?)";
> $sth = ibase_query( $db_handle, $sql, strtoupper($search_var1), strtoupper($search_var2));
> if ($sth) {
> if ($row = ibase_fetch_object($sth)) {
> //$save_in_variable = $row->FIELDNAME;
> }
> }
> ibase_free_result($sth);
>
> --- In firebird-php@yahoogroups.com, "jackdmason" wrote:
> >
> > Using the php interface is there a way to specify in the query the data fields are to be case insensitive such that a query such as:
> >
> > SELECT * FROM CUST WHERE LASTNAME LIKE 'mcg%' AND FIRSTNAME LIKE 'jo%'
> >
> > will find Josh Mcgee, josh McGee, Joe McGrath, john mcGregor, etc.?
> >
>