-
- /*
- @Solution to garbled Chinese characters in the library
- @bbs.it-home.org
- */
- include_once("conn.php");
- include_once("include. php");
- mysql_query("set names 'gbk'")or die("Failed to set character library n");
- mysql_select_db($db)or die("Failed to connect to database!n");
- $exec = " select * from $table";
- //echo $exec;
- $result = mysql_query($exec,$conn)or die("Query database failed n");
- echo "
";
- for($cout=0;$cout{
- $city = mysql_result($result,$cout,city);
- $name = mysql_result($result,$cout,name) ;
- $phone = mysql_result($result,$cout,phone);
- echo "
";
- echo "city: $city";
- echo "name: $name";
- echo "phone: $phone ";
- echo "
";
- }
- echo "
";
- ?>
Copy code
|