$query2 = mysql_query("select namemuseums from museums where idmuseums like '$permission%'");
mysql_query("set names utf8");
$row2 = mysql_fetch_row($query2);
$museumname = $row2[0];
echo($museumname);
When executing the top query statement, only one value appears, for example, 'a'. By the way, I tried to display the result value in php, but was it an encoding error?It pops up like this How do I solve it?
mysql php
Add the code below at the top of the php~
<?php header('Content-Type: text/html; charset=UTF-8'); ?>
It is recommended to set the default character set to utf8 for apache, php, and mysql.
How to change the character set
© 2024 OneMinuteCode. All rights reserved.