Edittype Select string not allowing variables

QuestionsEdittype Select string not allowing variables
Patricia Lawson asked 5 years ago

Hello
I am using edittype select, but my variable ($custId) in the SQL statement does not get resolved:

$col["edittype"] = "select";
$str = $details->get_dropdown_values(("SELECT a.ItemRef_ListID as k, a.ItemRef_FullName as v
FROM salesorderlinedetail a
JOIN (SELECT b.TxnID,b.CustomerRef_ListID
FROM salesorder b
WHERE CustomerRef_ListID = '$custID') Transactions
ON a.IDKey = Transactions.TxnID
JOIN iteminventory c
ON a.ItemRef_ListID = c.ListID
ORDER BY a.ItemRef_FullName ASC""));
$col["formatter"] = "select";
$col["editoptions"] = array("value" => $str);

It always shows as an empty string in the debugger:
SELECT a.ItemRef_ListID as k, a.ItemRef_FullName as v,a.IDKey

FROM salesorderlinedetail a

JOIN (SELECT b.TxnID,b.CustomerRef_ListID

FROM salesorder b

WHERE CustomerRef_ListID = '') Transactions

ON a.IDKey = Transactions.TxnID

JOIN iteminventory c

ON a.ItemRef_ListID = c.ListID

ORDER BY a.ItemRef_FullName ASC

I know the variable is not nul; I've checked it just beforehand. I have no problem using variables in my select_command statements. The statement works if I plug in an actual value.

Thanks!
Pat

1 Answers
Patricia Lawson answered 5 years ago

Please ignore above question: I had an error in my code.

Your Answer

10 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!