Problems with Ñ in PHP
Posted: Thu Mar 01, 2012 6:06 am
Please help!
I am developing a website, but i encountered problem in saving to MySQL database the character Ñ, when I tried to save the LastName DE LA PEÑA, it stores to a database like this DE LA PEÃ?, when i tried to view in a page it looks like this DE LA PEÃ?A , anybody who has an idea on how to solve this problem, below is my source code:
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
$sqlUpdateReg = "UPDATE registration set REG_ID = '$getID',FNAME = '$FirstName',MNAME = '$MiddleName',LNAME = '$LastName',COURSE_NAME='$Course',
YEAR_LEVEL = '$yearlevel',DATE_ENROLL='$dateEnroll',ENROLLMENT_STATUS='$enrollstatus' WHERE REG_ID = $getID";
$resultUpdate = @mysql_query($sqlUpdateReg) or die("Updating of Student Records is failed".mysql_error());
And i also include the code <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head>
Please help.
Thanks
I am developing a website, but i encountered problem in saving to MySQL database the character Ñ, when I tried to save the LastName DE LA PEÑA, it stores to a database like this DE LA PE&ATILDE;?, when i tried to view in a page it looks like this DE LA PE&ATILDE;?A , anybody who has an idea on how to solve this problem, below is my source code:
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
$sqlUpdateReg = "UPDATE registration set REG_ID = '$getID',FNAME = '$FirstName',MNAME = '$MiddleName',LNAME = '$LastName',COURSE_NAME='$Course',
YEAR_LEVEL = '$yearlevel',DATE_ENROLL='$dateEnroll',ENROLLMENT_STATUS='$enrollstatus' WHERE REG_ID = $getID";
$resultUpdate = @mysql_query($sqlUpdateReg) or die("Updating of Student Records is failed".mysql_error());
And i also include the code <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head>
Please help.
Thanks