Results 1 to 3 of 3

Thread: [RESOLVED] Query with an accent

  1. #1
    Join Date
    May 2009

    resolved [RESOLVED] Query with an accent

    I have a query to search for a name in a directory but there is an accent in the name and is not returning any results.

    PHP Code:
    $query "SELECT * FROM directory WHERE name=\"$name\""
    if I echo this I get:

    SELECT * FROM directory WHERE name="Lorquet, Sébastien"

    This returns nothing.

    In the database the name is as is and I checked this. It finds all other data except for the two entries that have an accent.

    I have also tried putting this code in

    PHP Code:
    header ('Content-type: text/html; charset=utf-8');

    but then I get the following results: Lorquet, SĂ©bastien

    I have also tried changing the setting in the table to utf8_general_ci and it still did not work.
    Last edited by beylah; 03-31-2014 at 12:42 PM.

  2. #2
    Join Date
    Aug 2004
    If you are using MySQL, here is some info I collected on the subject: http://www.ebookworm.us/utf8-in-php-and-mysql/
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    May 2009
    I have added this and it now works


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