时间:2021-07-01 10:21:17 帮助过:20人阅读
if(!mysql_connect("localhost","admin","admin"))
die("Could not connect:".mysql_error());
mysql_select_db("cesf");
$query="SET NAMES 'GB2312'";
mysql_query($query);
?>
$keyword=$_POST['keyword'];
$contents= array();
$rt=mysql_query("select * from dede_archives where title like '%$keyword%'");
while ($rs=mysql_fetch_array($rt))
{
$contents[]=$rs;
}
?>
查询实例
foreach($contents as $key=>$value){
echo "
$value[title] |