You must remember to define the character types later in the writing process.
mysql_query ("Set names ' GBK '")
The solution is so simple.
Today I made a database query, releasing the code.
Copy CodeThe code is as follows:
/*
filename:query.php
Do:get and show the data
Author:www.5dkx.com
*/
Include_once ("conn.php");
Include_once ("include.php");
mysql_query ("Set names ' GBK '") or Die ("set word repertoires failed \ n");
mysql_select_db ($db) or Die ("Connection database failed!\n");
$exec = "SELECT * from $table";
Echo $exec;
$result = mysql_query ($exec, $conn) or Die ("query database failed \ n");
echo "
{
$city = mysql_result ($result, $cout, city);
$name = mysql_result ($result, $cout, name);
$phone = mysql_result ($result, $cout, phone);
echo "
"; for ($cout =0; $cout
"; echo "City: $city"; echo "Name: $name"; echo "Phone: $phone"; echo "
"; } echo "
";
?>
http://www.bkjia.com/PHPjc/321573.html www.bkjia.com true http://www.bkjia.com/PHPjc/321573.html techarticle you must remember to define the character types later in the writing process. mysql_query ("Set names ' GBK ') solves the simple method. Today do a database query, release code ...