Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

    MySQL Query not working with french characters

    This is a strange issue.

    I can do a static query this:

    PHP Code:
    SELECT CONCAT(p.ProvinceName' - 'l.City' - 'UPPER(l.LocationCode)) As LocationNamel.LocationsID
    FROM Provinces p
    Locations l 
    WHERE p
    .ProvincesID l.ProvincesID AND CONCAT(p.ProvinceName' - 'l.City' - 'UPPER(l.LocationCode)) LIKE '%Québec%' 
    and it works fine, however if I query with a dynamic variable like this:

    PHP Code:
    SELECT CONCAT(p.ProvinceName' - 'l.City' - 'UPPER(l.LocationCode)) As LocationNamel.LocationsID
                            FROM Provinces p
    Locations l
                            WHERE p
    .ProvincesID l.ProvincesID
                            
    AND CONCAT(p.ProvinceName' - 'l.City' - 'UPPER(l.LocationCode)) LIKE '%" . $SearchTerm . "%' 
    I get nothing. Any idea what I'm going wrong here? This first query is just the second query printed out.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    Fixed using utf8_decode() in the query.


  •  

    Posting Permissions

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