[PHP] LIKE condition in query

2002-11-05 Thread Don Hicks
I'm writing an SQL query in a php 4.0 script. The query pulls data from an MS Access '97 database through an ODBC connection. I'm having difficulties creating a condition using LIKE. If I write the following expression, the query works: $Query= SELECT FieldName1, FieldName2 FROM TableName

Re: [PHP] LIKE condition in query

2002-11-05 Thread .: B i g D o g :.
I am not up on my MS Access database sql but i would check to see if ms access supports the like condition in the where clause... On Tue, 2002-11-05 at 18:49, Don Hicks wrote: I'm writing an SQL query in a php 4.0 script. The query pulls data from an MS Access '97 database through an ODBC

RE: [PHP] LIKE condition in query

2002-11-05 Thread Jay Blanchard
[snip] $Query= SELECT FieldName1, FieldName2 FROM TableName WHERE FieldName1 LIKE '$CriterionRecord' ; [/SNIP] The LIKE criteria needs to be surrounded by wildcards... WHERE FieldName1 LIKE '%$CriterionRecord%' HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] LIKE condition in query

2002-11-05 Thread Don Hicks
BINGO! That was exactly what I needed! Thanks! Don. === Jay Blanchard [EMAIL PROTECTED] wrote in message news:003801c284fc$4fd8d2b0$8102a8c0;000347D72515... [snip] $Query= SELECT FieldName1, FieldName2 FROM TableName WHERE FieldName1 LIKE '$CriterionRecord' ; [/SNIP] The