• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

WHERE statement in databasejoin

elle

Member
Hello everyone,

I'm really not fit in MySQL! Really!
So please help me to get the right WHERE statement in my databasejoin element.
This is may setup:
I have a table named "tage", where stored a specific range of days, that is used just like an account.
The fields there are:

id | date_time | firma_tage | markt_tage | von | bis | tage | verbraucht | uebrig


In my new table named "terminplaner" I have the following elements (fields):

id | date_time | markt_planer | von_Planer | bis_Planer | firma_planer

The element firma_planer is a databasejoin element, with the following setup:
Options
  • Plugin: databasejoin
Data
  • Render as: Checkbox
  • Table: tage
  • Value: id
  • Label: firma_tage
Data - where
  • HERE is where i need youre help to do the following:
The element firma_planer should display only these firmas, who's stored in the table 'tage' AND where the field markt_tage = markt_planer (the element in my new form 'terminplaner' ) AND where the field uebrig > 0

I have tryed something like this:
Code:
WHERE {thistable}.'markt_planer'
  IN ( SELECT tage.firma_tage FROM tage
    WHERE tage.markt_tage = {thistable}.'markt_planer'
    AND tage.uebrig > 0)
But that does'nt work.

Can you help me please?
Bildschirmfoto 2014-11-11 um 17.34.19.png
Bildschirmfoto 2014-11-11 um 17.34.46.png
Bildschirmfoto 2014-11-11 um 17.35.04.png

Best regards
Elle
 
Hi there,

I've fixed my prob by myself. (And am a bit of proud ;-))

I choose a cacscadingdropdown for my firma_planer element and took the WHERE statement into the Where query field:
Code:
{thistable}.uebrig > 0

But theres another problem:
The element firma_planer should only display entrys, if they are in the table "tage" between the dates, stored in "von" and "bis", compared to the elements in my form "terminplaner___von_Planer" and "
terminplaner___bis_Planer".
How can I put this in my Where query???

Thanks for your help again.

Regards
Elle
 
I don't get your setup but some principel remarks:
- You may test your query in phpMyAdmin directly until it's displaying what you need, then adapt for the Fabrik WHERE (with {thistable} etc.)
- If it can't be done whith a MySQL query you can use the "Eval options" (Advanced tab). Returning FALSE for an option won't show this option.
- If the options are depending on user input you can't do it with a dbjoin and WHERE or Eval options (this is only run on form load). You need a cascading dropdown element watching this other element or have to add your own JS.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top