How can I obtain the enumerated values in mysql? Array & nbsp; (& nbsp; [0] & nbsp ;=& gt; & nbsp; 1 & nbsp; [1] & nbsp ;=& gt; & nbsp; storylok & nbsp; [2] & nbsp ;=& gt; & nbsp; lele1989 & nbs how to obtain enumerated values in mysql?
Array ([0] => 1 [1] => storylok [2] => lele1989 [3] =>? )
Why is the retrieved enumeration type question mark? I can see it in the mysql console. The character set PHP and mysql are both utf8. how can I obtain the enumerated value.
Header ("Content-Type: text/html; charset = utf-8 ");
$ Host = "localhost ";
$ User = "root ";
$ Password = "";
@ $ Conn = mysql_connect ($ host, $ user, $ password) or die ("database connection failed. Please check the database configuration! ". Mysql_error ());
$ TableName = "viuoo ";
Mysql_select_db ($ tableName, $ conn) or die ('database table selection error. Please check whether the database table name is correct! ');
Mysql_query ("set names 'utf-8 '");
$ Dm = "SELECT * FROM user ";
$ Result = mysql_query ($ dm, $ conn );
While ($ res = mysql_fetch_row ($ result )){
Print_r ($ res );
}
?>
Mysql php utf8 database shared :? 1? [1]? =>? Storylok? [2]? =>? Lele1989? [3]? ==> ???) Why is the retrieved enumeration type question mark ?? In mysql control... 'data-pics = ''>
------ Solution --------------------
Mysql_query ("set names 'utf-8 '");
Modify
Mysql_query ("set names 'utf8 '");