Encoding PHP MySQL -
i can see query results see � character characters "Á".
basic connection this:
$mysqli = new mysqli(server, user, pass, db); mysqli_set_charset($mysqli, 'utf8');
i tried with:
$mysqli->query("set names 'utf8'"); $mysqli->set_charset("utf8"); mysql_query("set names 'utf8'");
but characters still watching.
query
function connection($mysqli) { mysql_query("set names 'utf8'"); if ( ! $link = mysqli_connect("localhost", "user", "pass") ) { echo ("error"); return false; } if ( ! mysqli_select_db($link, "db") ) { echo ("error"); return false; } if ( ! $consulta = mysqli_query($link, $mysqli) ) { echo ("error"); return false; } return $consulta; }
all files saved utf8, var columns in db utt8 too.
what or problem?
thank you!
maybe php file saved ansi doc, try utf8 without bom. try declare charset utf8 on output file.
hope help
Comments
Post a Comment