我已经查看了之前所有相关的答案以及相似之处,但无法找到我可能出错的内容 - 我在同一个php中有类似的内容,并且所有工作都符合预期。我的代码是:
$boomi=mysql_query("SELECT round(boomi.dspeed/func.min_line_speed *100, 0)
AS diff FROM func INNER JOIN boomi ON func.service_id=boomi.service_id
WHERE func.min_line_speed > boomi.dspeed AND boomi.sync='Yes'
AND func.service_id=%s", SQLVal($service_id, "int"));
$diff = mysql_result($boomi, 0,'diff');
第二个错误表明结果中的参数1($ diff)IS NULL