MySQL错误“查询为空”

时间:2017-05-29 10:47:35

标签: php mysql sql cron

$send_event = $db->query(sprintf("SELECT `bmembMember` FROM `bmembBusiness` = '%u' WHERE `bmembBusiness` = '%u' ORDER BY `bmembId` DESC", $bs['busId'])) OR die('Cron not run') ;
while($se=$db->fetch_row($send_event))
{
$text = "The {$bs['busName']} business went bankrupt\, all members have been made redundent." OR die('Cron not run');

由于

3 个答案:

答案 0 :(得分:2)

您的sprintf使用2个值,但您只提供一个。无论如何都不需要一个,那条线应该是

$send_event = $db->query(sprintf("SELECT `bmembMember` FROM `bmembBusiness` WHERE `bmembBusiness` = '%u' ORDER BY `bmembId` DESC", $bs['busId'])) OR die('Cron not run') ;

答案 1 :(得分:1)

修复应修复查询的FROM条款。

 ...FROM `bmembBusiness` WHERE...

答案 2 :(得分:-1)

查询的高位区域错误,

" SELECT bmembMember FROM bmembBusiness ='%u' WHERE bmembBusiness ='%u&# 39;订购者bmembId DESC",$ bs [' busId'])

尝试使用此修复查询: -

  

SELECT bmembMember FROM Table_name WHERE bmembBusiness '%u'   ORDER BY bmembId DESC,abs(busId);