Is it possible to do an SQL query, then use the result of the query in a Table view?
In other words, can we write an SQL Query using 'Custom HTML' with the name somephpcode.
Then in the "Table provider" field for table, can we use eg. {view:somephpcode} to generate a table?
Well you wouldn't use Custom HTML you'd use PHP (under logic).
And yes. Except you'd use {var: not {view:
https://docs.joomla.org/Special:MyLanguage/Selecting_data_using_JDatabase
You need to use {fn:phpcode} first
You also need to RETURN the result.
It also helps if you use {debug:} at the end of your event to see what your data looks like.
Looks like {var:test.returned} should work then
Still doesn't output data in the table. It's still missing a further array key after [0] though (ie coursework, which was the model name for read_data), would that matter?
It shouldn't. Did you tick the"show all fields" or whatever box?
Ahhh yep my bad didn't need the .returned
This is what happens when you answer forum questions at 12am in bed on a phone.