我有以下代码,但我的 mysql 查询没有返回任何值。请告诉我我做错了什么:
foreach($stagearray as $catgry){
echo $catgry;//this is returning the values
$sql = mysql_query("
select
count(reference) as CCOUNTS,
assignee_group
from
issue_tracking_issues i,
issue_tracking_issues_issue_tracking_projects j
where
status NOT LIKE 'Closed%'
AND i.id=j.issue_tracking_issue_id
AND j.issue_tracking_project_id=1
and $value
having
SUBSTR(date_raised,3,3)
group by
assignee_group
");
while($rows = mysql_fetch_array($sql)){
这给了我以下警告:
PHP 警告:mysql_fetch_array():提供的参数不是有效的 MySQL 结果资源
我猜我的 sql 查询无法解析 $catgry 但我不知道为什么