Need SQL Help for PHP_WIN and ODBC/Access
| From: | Williams, Dewey | Date: | Thu, 03 Oct 2002 20:59:11 +0000 |
| Subject: | Need SQL Help for PHP_WIN and ODBC/Access | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-16147@lists.php.net to get a copy of this message | ||
HELP!
I am trying to write an sql statement to get data from my Access database
through ODBC. Everything works okay if I write a simple Select statement,
but I need to write a statement like:
"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files ON
Products.bid = Files.bid WHERE Products.ProdName LIKE *" . $ProdVar . "*";
I need the WHERE statement to use LIKE and wrap the variable $ProdVar in *
so users can do a text search on the field.
This is where things get nasty. I have tried every combination of * "" .
LIKE etc and get no records returned or an Access ODBC driver error saying
that there were "too few parameters. Expecting 1."
If anyone has a clue on how to write this statement, what is wrong with the
above, what can be fixed, changed, etc in php to make it work ... I would
really appreciate a hand.
Thanks
Dewey Williams
williams@email.uncc.edu