Database join...is it different then older fabrik versions?

Racmitch

Member
Hi Guys,
Trying to set up a database join in the new version of fabrik. I have access to the old system and fabrik configuration i used before to make this work, however after adding the same statements and such I am getting this error
"
1054
Unknown column 'goal_planning_sheets.userid' in 'where clause' SQL=SELECT DISTINCT(`goal_planning_sheets`.`goal`) AS value, `goal` AS text FROM `goal_planning_sheets` AS `goal_planning_sheets` WHERE `goal_planning_sheets`.userid = '815' ORDER BY text ASC"

I configured the dbase join with the proper table, connection, value and label and it does work, showing the information from the specific table i want to join to, the issue/error occurs when I try to add the old fabrik "where" statement "where {thistable}.userid = '{$my->id}' " to the "joins where and/ororder by statement (SQL) so that a logged in user can only see their input to the table I'm trying to join to.

did something change, or what am I doing wrong in that new version that did work in the older versions of Fabrik?
 
it seems your table/list goal_planning_sheets doesn't have a column/ element userid.
Maybe you've changed the name?

gesendet mit Tapatalk
 
nope didn't change a thing, the goal_planning_sheets has an id and user element
goal_planning_sheets___id
goal_planning_sheets___user
it also has a data>prefilter to call only a user's entry that works correctly
 
Hi
Just a detail : sometimes, for me, in the database join element plugin, the"Concat" option create problems. For example when your element is him-self in an other group from a table join.
Do you use the "Concat" option in your db join element ? If yes, try whithout...
Maybe...
 
coullet: The table I want to use is correct to have the dbjoin element work correctly. If i don't add the "where" statement it (the db join ele) shows the enteries into that table, the trouble starts when I add the "where {thistable}.userid = '{$my->id}'...which in an older version of fabrik worked correctly to only show that users entries, now it gives an error. I listed the id and user tables to show troester that i had those elements added to the form elements

georgie: I have never had or tried to use the concat option, Hugh showed me how to use this element a while back and I mirrored the set up from what he showed me. The new form is exactly the same as the older/working form, but now I get an error.
 
Have you try:

{thistable}.userid = {$my->id}

or just

userid = {$my->id}

Often the tag {$my->id} does not need quote.
 
coullet: The table I want to use is correct to have the dbjoin element work correctly. If i don't add the "where" statement it (the db join ele) shows the enteries into that table, the trouble starts when I add the "where {thistable}.userid = '{$my->id}'...which in an older version of fabrik worked correctly to only show that users entries, now it gives an error. I listed the id and user tables to show troester that i had those elements added to the form elements

georgie: I have never had or tried to use the concat option, Hugh showed me how to use this element a while back and I mirrored the set up from what he showed me. The new form is exactly the same as the older/working form, but now I get an error.

I have a question for you: the database element is a copy of another element? in that case try to unlink the copy from the original and save the changes.
 
You haven't answered Troester and Coullet's question, which is all I can ask. You say your field is goal_planning_sheets___user, but you are referencing 'userid' in the query. And it's telling you that the columns 'userid' doesn't exist. So have you tried changing that to just 'user' in your WHERE clause?

-- hugh
 
ok..sorry...i thought I did answer that, i did use user, user(raw), and id and still got the error. But reading back just now to see if i did post a response to their question, I saw georgie suggested removing the (') 's from around the {$my->id} as it was in the old dbase joins in an earlier version and now it works(with "user", no quotes) as it's supposed to..sorry for the inconvenience and thinking I did reply. Also thanks everyone for the help
 
Hmmm, I still don't see how using userid in the where clause, when your field is just user (no id on the end) would work.

Anyway, glad it's fixed.

-- hugh
 
yea..i followed the last build we worked on to the letter with dbase joins and that one used userid as well...I don't know either...but yeah...happy it's working...
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top