php调用数据库
数据库,图片里有类别字段为bg。例如一个类别为:类别1,调用一个页面入<aherf="product.php?bg=类别1">类别1</a>$bg=$_GET['bg']...
数据库,图片里有类别字段为bg。例如一个类别为:类别1,调用一个页面入
<a herf="product.php?bg=类别1">类别1</a>
$bg=$_GET['bg'];
if($bg<>""){
$sql="SELECT * FROM 'works' where 'bg'={$bg} order by id desc LIMIT {$offset},{$size}";
}else{
$sql="SELECT * FROM 'works' order by id desc LIMIT {$offset},{$size}";
}
怎么只调用到全部的数据而不是类别1里面的
$sql="SELECT * FROM 'works' where 'bg'='{$bg}' order by id desc LIMIT {$offset},{$size}";
}else{
$sql="SELECT * FROM 'works' order by id desc LIMIT
所有数据能调出来但是类别还是掉不出来 展开
<a herf="product.php?bg=类别1">类别1</a>
$bg=$_GET['bg'];
if($bg<>""){
$sql="SELECT * FROM 'works' where 'bg'={$bg} order by id desc LIMIT {$offset},{$size}";
}else{
$sql="SELECT * FROM 'works' order by id desc LIMIT {$offset},{$size}";
}
怎么只调用到全部的数据而不是类别1里面的
$sql="SELECT * FROM 'works' where 'bg'='{$bg}' order by id desc LIMIT {$offset},{$size}";
}else{
$sql="SELECT * FROM 'works' order by id desc LIMIT
所有数据能调出来但是类别还是掉不出来 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询