Results 1 to 3 of 3

Thread: wildcard search

  1. #1
    Join Date
    Aug 2006
    Posts
    3

    Unanswered: wildcard search

    how do you use a variable $var and the % wildcard symbol in a query? I have tried every combination I can think of and nothing has worked...any help would be appreciated! Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    which language does the $var come from? because we should really move your question to the appropriate forum

    in coldfusion you would write
    Code:
    <cfparam name="form.searchwords" default="">
    <cfset var = form.searchwords>
    <cfquery name="wildcardsearch" datasource="#dsn#">
      select foo, bar, fap
        from daTable
       where qux like '%#var#%'
    </cfquery>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2006
    Posts
    3
    sorry about that I am using php.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •