function class_id(){
if(!empty($_GET['class_id'])){
$sql="select * from goods_class as a,goods_detail as b where a.id=b.class_id and a.id='$_GET[class_id]'";
$query=mysql_query($sql);
while($row_class=mysql_fetch_array($query)){
$sm_class[]=array("name"=>$row_class['goods_name'],"id"=>$row_class['id'],"picture"=>$row_class['picture']); }
}
return $sm_class;
//print_r($sm_class);
}class_id();
$smarty->assign("sm_class",$sm_class);if语句放到方法外可以再html中正常显示,上面这样写则不行,为什么?
if(!empty($_GET['class_id'])){
$sql="select * from goods_class as a,goods_detail as b where a.id=b.class_id and a.id='$_GET[class_id]'";
$query=mysql_query($sql);
while($row_class=mysql_fetch_array($query)){
$sm_class[]=array("name"=>$row_class['goods_name'],"id"=>$row_class['id'],"picture"=>$row_class['picture']); }
}
return $sm_class;
//print_r($sm_class);
}class_id();
$smarty->assign("sm_class",$sm_class);if语句放到方法外可以再html中正常显示,上面这样写则不行,为什么?
解决方案 »
- php并发问题
- php站点中页面有乱码Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text
- 网站如何检测同一人用两个帐号登录?
- 请教一个验证码的问题
- 如何让Apache支持<!--#include virtual="../include/top.htm"-->这种语法?
- js里能否对上传的file文件首先进行判断是否为空?
- php查询mysql,报错~(菜鸟)
- 新手问个问题,各位大神在吗????小弟跪拜了!!!
- PHP5中用GET方式提交表单时不支持中文,如何解决?
- php curl post返回的数据怎么是这样啊?
- 求教PHP上传图片问题,总不能上传
- 链接库(txt)与可以查询功能就这点分了。
$smarty->assign("sm_class",$sm_class);