www.webdeveloper.com
Results 1 to 4 of 4

Thread: hii folks i have doubt on mysql

  1. #1
    Join Date
    Nov 2012
    Posts
    20

    hii folks i have doubt on mysql

    friends i'm trying with mysql like and OR operator but i'm not getting exact output.

    SELECT registration1.*,registration2.*
    FROM registration1 JOIN registration2
    ON registration2.emailid=registration1.emailid
    WHERE(keyskills LIKE '%$search%') OR (keyskills='$search1')


    this is my code. LIKE operator is working properly but keyskills='$search1' this is not working while using keyskills LIKE '%$search%' this. please let me know what mistake i did...
    please friends it's very urgent help me....

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,933
    What type of field is "keyskills"?

    What is the actual value of $search1 when you get to that point? (Not what you think it should be, but determine via debugging what it definitely is.)

    If it's a text value, (which you are indicating by having quoted it), have you properly escaped any special characters with the applicable function for whichever database extension you are using?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Nov 2012
    Posts
    20
    keyskills data type is VARCHAR(50), and I'm getting output with out that keyskills LIKE '%$search%'

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,933
    Might I suggest that in copy and paste the actual PHP code being used to define the query here, in between [php]...[/php] tags, so that we can see exactly what you are doing?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles