<?
function house_list($TypeID,$num,$len=14){
if ($TypeID)
{
$sql=" and TypeID=".$TypeID."";
}
$sql="select * from house where isshow='1' ".$sql." order by id desc limit 0,$num";
//echo $sql;
$result=mysql_query($sql);
@$numrows=mysql_num_rows($result);
if($numrows==0)
{
echo "<br> 还没有添加信息...";
}
else
{
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" >
<?
while($bd = mysql_fetch_array($result)){
$bt=$bd['xiaoqu'];
if(strlen($bt)>$len)
$bt=cnsubstr($bt,$len);
$TypeID=$bd['TypeID'];
if($TypeID==2||$TypeID==5)
{
$price=$bd['jiage']."元";
}else{
$price=$bd['jiage']."万元";
}
?> 明明TypeID==2,为什么只有万元能生效
function house_list($TypeID,$num,$len=14){
if ($TypeID)
{
$sql=" and TypeID=".$TypeID."";
}
$sql="select * from house where isshow='1' ".$sql." order by id desc limit 0,$num";
//echo $sql;
$result=mysql_query($sql);
@$numrows=mysql_num_rows($result);
if($numrows==0)
{
echo "<br> 还没有添加信息...";
}
else
{
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" >
<?
while($bd = mysql_fetch_array($result)){
$bt=$bd['xiaoqu'];
if(strlen($bt)>$len)
$bt=cnsubstr($bt,$len);
$TypeID=$bd['TypeID'];
if($TypeID==2||$TypeID==5)
{
$price=$bd['jiage']."元";
}else{
$price=$bd['jiage']."万元";
}
?> 明明TypeID==2,为什么只有万元能生效
echo $TypeID;//输出看看
$TypeID=$bd['TypeID'];
var_dump($TypeID);//输出看看
var_dump($TypeID);//这么写以后,出现了NULL
你不是跟我开玩笑吧,写10个=都没用
出现null也就是没有值 所以就出现万元
// $TypeID=$bd['TypeID'];
注释了看看