Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP/MySQL Unknown column.......in 'where clause'

Status
Not open for further replies.

sidvicious

Programmer
Feb 2, 2005
8
SE
Hi - Hope someone can help me with this, driving me nuts.

Form with 3 fields & submit button. Method set to "GET".

Results page has URL bindings for the passed parameters, and these appear to be working ok since I put a field on the page to display the first parameter, bound it etc, and it's passed across fine.

In the advanced recordset definition, I've got the following SQL :-

SELECT *
FROM acOffers
WHERE acOffersType = TypeVar

then in variables TypeVar is defined with a default value of '%' and runtime value of $_GET['acOfferQueryType'].

When I run the 'search' page and enter say 'TRYTHIS' as the value for 'acOfferQueryType', then the 'results page displays the error :-

Unknown column 'TRYTHIS' in 'where clause'

I've tried using quotation marks instead of single quotes in the runtime value field, but the same thing happened.

It's driving me mad and really holding me up so any help would be really appreciated.

Cheers
 
Oh Sheeeeeite,

SQL should've been :-

SELECT *
FROM acOffers
WHERE acOffersType = 'TypeVar'
(just the single quotes missing around TypeVar).

Still can't get the default wildcard ('%') to work though - zero results ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top