Results 1 to 2 of 2

Thread: Query contains mismatched quotes

  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Query contains mismatched quotes

    Hi,

    Could u please help me in this.. When i run the query below, its showin an error as "Query contains mismatched quotes".. I think its because of the quote in the name of the customer.. but how to solve this problem.. please help.. Note: I've bolded and underlined the statement where i feel its wrong..

    SELECT * FROM BILLING_2008
    WHERE CUSTOMERNAME="CITIZEN'S WORLD" order by COUNTRY

    the actual problem is tat its calling the records using a variable.. like this..

    WHERE CUSTOMERNAME='$CUSTNAME'

    and CITIZEN'S WORLD is one record from that table.. is thr any alternate way to display names like the one above ie, with quotes in between the words..??

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You could use functions like mysql_real_escape or addcslashes or the like. I would go into more detail, but currently short on time at the moment.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

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