Skip to main content
Topic: How can I add php command to custom view Query as parameter? (Read 5064 times) previous topic - next topic

Re: How can I add php command to custom view Query as parameter?

Reply #16
@machobymb‍ after going through the project you sent me, I found out that the cause of your error is the "ORDER BY tbl1.hname, tbl2.kname". This is because phprad has a created PHP function to handle the ORDER BY. When you add yours to the custom query, it clashes with the one generated by the phprad function which makes the query un-executable. And the option to select the columns you want to order the items by, like that of the Database Tables->List Page Properties->Order By is not available for the Custom Views. In summary, remove the "ORDER BY tbl1.hname, tbl2.kname" from the query and the error should be gone.

Re: How can I add php command to custom view Query as parameter?

Reply #17
THX Willvin!
It's work. When will the sorting option come in? (Even if I set the ascending order by the first column, it has no effect.)


Re: How can I add php command to custom view Query as parameter?

Reply #19
Hi WillVin! I'd like to know, that can I to add Query parameters to Custom View in 2.7.3?


Re: How can I add php command to custom view Query as parameter?

Reply #21
Thx!
Can I in the PHPHrad this: I create a  List page and in Where clouse I add a subquery.
Example query to List page :  SELECT * FROM table1 WHERE attr1=(SELECT attr2 FROM table2 WHERE attr3=USER_ID)
The WHERE clouse: "attr1=(SELECT attr2 FROM table2 WHERE attr3=".USER_ID.")" (to Where field)

OR
I create 1-1 Custom View to every campany?