如题:为什么PHP站内搜索只能搜索英文和字母,不能搜索中文?
搜索中文后,显示空白,请大侠们,指点迷津!
<?php
if(!mysql_connect("localhost","admin","admin"))
die("Could not connect:".mysql_error());
mysql_select_db("cesf");
$query="SET NAMES 'GB2312'";
mysql_query($query);
?>
<?php
$keyword=$_POST['keyword'];
$contents= array();
$rt=mysql_query("select * from dede_archives where title like '%$keyword%'");
while ($rs=mysql_fetch_array($rt))
{
$contents[]=$rs;
}
?>
<html>
<head><title>查询实例</title></head>
<body>
<?php 
foreach($contents as $key=>$value){
echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" width=\"600\" style=\"border-collapse:collapse;\">";
echo "<tr><td>$value[title]</td></tr>";
echo "</table>";
}
?>
</body>
</html>