Sort with databasejoin field

FLAG

New Member
Hello everyone,
I will need some help on Fabrik's field databasejoin.
I have a table with item titles and category.
I have selected the table with the titles and I would like to sort for a specific category.
table = table
choice = Titles
catid = 8
I can't find the right sql query with where.
Can you give me a little help, I'm not very good at queries...
Thank you.
 
Do you want to filter the lookup table (i.e. only show titles with catid=8)?
Then in Data-where do
{thistable}.catid = 8
(litterally {thistable})
 
I paste this code in the data-where tab then in filter Where?
Sort of.
You see you are in the "Data" tab, not in the "Data-where" tab as @troester said?
There you have the field "Joins where and/or order by statement (SQL)".

As always, it's very much worth reading the tooltip there, and of course the Wiki on this.
 
oh, no
Remove
(litterally {thistable}),
this was only a hint that you have to use "thistable", not a real table name.
 
You didn't read either tooltip (I don't know what it would say in French, but in English it's correct) or Wiki...
The complete correct expression there must be
Code:
WHERE {thistable}.`catid` = 8

EDIT:
Also, and this should be needless to say (?), make sure you remove your entry in the "Data" tab...
 
I read but too much information kills the information!
if my table is "twrpz_items_tmp" the query should be: WHERE {twrpz_items_tmp}.`catid` = 8
Still a 1064 error, I did delete the entry in Data.
 
Great, it works very well.
I hope this topic will be helpful to others.
A big thank you to you.
I wish you a very nice weekend.
You are super !
 
Good. Next time not only read, but also try to understand and learn "how" and "why"... which the very few lines relevant in this case in both tooltips and Wiki are meant for. Saves a lot of time, avoidable errors, and repetition. Thank you.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top