I can't get it to work with the variable. Here's my scenario.
Table 1 Field name: Document
Table 2 Field that is in common: docnum
Link info for page that has Table 2 embedded in it:
www.logochairs.com/j25cms/index.php/account/my-open-orders?id=138
I want each value in the 'PONum' column of table 1 to be a clickable link, and when clicked, it uses the value from the "Document" field that was clicked on as the variable value, that is used in the where clause of query of Table 2.
I want to refer to this variable as "currentPo" if I can do that. Is this exactly what I should put in the "Format" column of the "column settings" in the module admin for Table 1?
index.php?option=com_content&view=article&id=138¤tPo={$value}
Also, should "Document" be in the "ID" column of the "column settings" or "currentPo"?
In my query for Table 1, this is what I currently have:
SELECT OrderDate AS 'Ordered On', CONCAT( '<a href="index.php?option=com_content&view=article&id=138¤tPo={$value}">', `PONum`, '</a>' ) AS 'PO #', Shipto as 'Ship To', Shipdate as 'Ship Date', cancel as 'Cancel Date', CONCAT( '$', `total` ) AS 'Total Amount'
FROM `openorders`
WHERE UserID = {$UserLogin}
Does it matter that "Document" isn't SELECTed in the query?
In my query for Table 2, I currently have:
SELECT *
FROM `items`
WHERE docnum = {$REQUEST:currentPo}
Is the concatenated link for 'PONum' correct in the table 1 query? I assume I have to do it this way to make it a clickable link, right?
Do I need to do anything to column settings in Table 2 at all?
Right now, the variable is not working and therefore returning no data in table 2. Can you see what I'm doing above and let me know what I am doing wrong?
Thanks so much!