[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.
if I echo this I get:
$query = "SELECT * FROM directory WHERE name=\"$name\"";
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
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 11:42 AM.
If you are using MySQL, here is some info I collected on the subject: http://www.ebookworm.us/utf8-in-php-and-mysql/
"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
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
I have added this and it now works
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)