note 38642 deleted from function.odbc-result by nlopess
| From: | nlopess@php.net | Date: | Thu, 01 Jan 2004 16:23:30 +0000 |
| Subject: | note 38642 deleted from function.odbc-result by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62748@lists.php.net to get a copy of this message | ||
Note Submitter: joe@squarefour.net
----
When using this ODBC function to call out results from a MS Access database using the
"LIKE" operator, you may find you are ending up with nothing.
My reason for this was because I had been using the SQL wildcard '*' in my query. Access
does not use this wildcard but instead uses '%', hence the reason why I did not get any
data back.
So just change the '*' to '%' and all problems should be solved.
Ex:
Doesn't work:
SELECT fieldname FROM table WHERE fieldname LIKE '*searchstring*'
Does work:
SELECT fieldname FROM table WHERE fieldname LIKE '%searchstring%'