try
"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files
ON
Products.bid = Files.bid WHERE Products.ProdName LIKE ' * " . $ProdVar .
" * ' "

pls. remove spaces arnd * , i hv put them to make clearly visible single &
double quotes.

this may also work:

"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files
ON
Products.bid = Files.bid WHERE Products.ProdName LIKE '\"*" . $ProdVar .
"*\""


regds,
-----Original Message-----
From: Williams, Dewey [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 02:29
To: [EMAIL PROTECTED]
Subject: Need SQL Help for PHP_WIN and ODBC/Access


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
[EMAIL PROTECTED]


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to