note 38642 added to function.odbc-result
| From: | joe at squarefour dot net | Date: | Wed, 31 Dec 2003 16:58:02 +0000 |
| Subject: | note 38642 added to function.odbc-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62727@lists.php.net to get a copy of this message | ||
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%'
----
Manual Page -- http://www.php.net/manual/en/function.odbc-result.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38642
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38642&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38642&report=yes
Search -- http://master.php.net/manage/user-notes.php