如何将两个参数传递到vtiger中的select到select查询?

如何将两个参数传递到vtiger中的select到select查询?,vtiger,vtigercrm,dynamic-picklist-vtiger,Vtiger,Vtigercrm,Dynamic Picklist Vtiger,我想将两个参数传递给vtiger自定义函数中一个场景的SELECT查询。如下图所示 function start_date($projectid, $stage){ $adb = PearDatabase::getInstance(); $stage = "Stage-0"; $data = $adb->pquery("SELECT startdate FROM vtiger_projecttask WHERE projectid = ?", arra

我想将两个参数传递给vtiger自定义函数中一个场景的SELECT查询。如下图所示

function start_date($projectid, $stage){

$adb = PearDatabase::getInstance();

        $stage = "Stage-0";

        $data = $adb->pquery("SELECT startdate FROM vtiger_projecttask WHERE projectid = ?", array($projectid), array($stage);

        $num_rows = $adb->num_rows($data);

        for($i=0; $i<$num_rows; $i++) {
            $col3[$i] = $adb->query_result($data, $i,'startdate');      
        }
}
函数开始日期($projectd,$stage){
$adb=PearDatabase::getInstance();
$stage=“stage-0”;
$data=$adb->pquery(“从vtiger_projecttask中选择startdate,其中projectd=?”,数组($projectd),数组($stage);
$num_rows=$adb->num_rows($data);
对于($i=0;$iquery_结果($data,$i,'startdate');
}
}
但它不允许我执行这种类型的查询。如何在vtiger中使用两个参数形成查询


谢谢并致以问候。

请按以下方式尝试此代码。这将起作用

function start_date($projectid, $stage){

$adb = PearDatabase::getInstance();

    $stage = "Stage-0";

    $data = $adb->pquery("SELECT startdate FROM vtiger_projecttask WHERE projectid = ? and stage = ?", array($projectid,$stage));

    $num_rows = $adb->num_rows($data);

    for($i=0; $i<$num_rows; $i++) {
        $col3[$i] = $adb->query_result($data, $i,'startdate');      
    }
}
函数开始日期($projectd,$stage){
$adb=PearDatabase::getInstance();
$stage=“stage-0”;
$data=$adb->pquery(“从vtiger_projecttask中选择startdate,其中projectd=?和stage=?”,数组($projectd,$stage));
$num_rows=$adb->num_rows($data);
对于($i=0;$iquery_结果($data,$i,'startdate');
}
}

根据您的问题,我给出的答案是完美的。如果您没有得到解决方案,请告诉我您到底需要什么,以便我可以更新我的答案很高兴听到这个消息