I'm using jqGrid, on edit/add function I want to have a drop down list in one of these fields.
This works if i use the setSelect function as this:
$grid->setSelect("title", "SELECT DISTINCT name,name as TestingName FROM template", true, true, false, array(""=>"All"));
How can I pass parameters to my query? I tried these:
1-"SELECT DISTINCT name,name as TestingName FROM template where tempid = ?"
2- "SELECT DISTINCT name,name as TestingName FROM template where tempid = $rowid"
3-"SELECT DISTINCT name,name as TestingName FROM template where tempid = ". $rowid
none of the above worked while having:
if(isset ($_REQUEST["tempid"]))
$rowid = jqGridUtils::Strip($_REQUEST["tempid"]);
else
$rowid = "";
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…