2024-11-07 01:15:25
2024-11-07 09:38:03
$sql="select count(imageid) from images where categoryid=".$c." and actived = 1"
我的意思是要统计有多少条记录。这样查询后,怎么返回记录数了。
$number=count(imageid):不对的了。
$sql="select count(imageid) AS c from images where categoryid=".$c." and actived = 1";
$query = mysql_query($sql);
$arrResult = mysql_fetch_row($query);
$number = $arrResult['c'];
看懂了没?
2024-11-07 01:04:22
我的意思是,在外部使用时,应该怎么写。例如:
if(count(imageid)>0){
}
这里的count怎么使用!
select count(imageid) as number from interp_images where categoryid=".$c." and actived = 1"
外部就用 if($number)>0{
}
2024-11-07 14:46:08