yz_wang
(yz_wang)
新手上路

初级会员
UID 51407
精华
0
积分 8
帖子 6
金钱 8 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2004-11-19
状态 离线
|
[推荐阅读] 水区是俺家,发展靠大家.
源码挺长的,我怕给大家添麻烦:(
源码如下:大家要有心理准备啊!!提示的就是最后四行有错误:(
<?
$text=$_POST["text"];
$type=$_POST["type"];
$sql=""; $sql1=""; $sql2=""; $sql3="";//第二个sql改成sql1
if((trim($text)!="")&&($type=="4"))
{ $sql1=$sql1."select * from `fquestion` where QContent like '%".$text."%'";
$sql2=$sql2."select * from `squestion` where QContent like '%".$text."%'";
$sql3=$sql3."select * from `question` where QContent like '%".$text."%'";
}
else if((trim($text)=="")&&($type!="4"))
switch($type)
{ case "0" sql1="select * from `fquestion`";
$sql2="select * from `squestion`";
$sql3="select * from `question`;";
break;
case "1" sql="select * from `fquestion`;";break;
case "2" sql="select * from `squestion`;";break;
case "3":$sql="select * from `question`;";break;
}
else if((trim($text)!="")&&($type!="4"))
switch($type)
{ case "0":$sql1="select * from `fquestion` where QContent like '%$text%'";
$sql2="select * from `squestion` where QContent like '%$text%'";
$sql3="select * from `question` where QContent like '%$text%'";
break;
case "1":$sql="select * from `fquestion` where QContent like '%$text%'";break;
case "2":$sql="select * from `squestion` where QContent like '%$text%'";break;
case "3":$sql="select * from `question` where QContent like '%$text%'";break;
}
echo"xixi,$text,$type,$sql,$sql1,$sql2,$sql3";
$result=mysql_query($sql);
$result1=mysql_query($sql1);
$result2=mysql_query($sql2);
$result3=mysql_query($sql3);
$num=mysql_num_rows($result);
$num1=mysql_num_rows($result1);
$num2=mysql_num_rows($result2);
$num3=mysql_num_rows($result3);
[ 本帖最后由 yz_wang 于 2006-5-19 10:14 PM 编辑 ]
|
|