Have a single dropdown box need to use where clause for current group.

D

New member

About/upgrade​

DaDaBIK™ is a product conceived and developed by Eugenio Tacchini
Copyright © 2001-2022 Eugenio Tacchini
Proudly ❤️ made in Emilia
dadabik.com

Your current DaDaBIK version​

You are using DaDaBIK version 11.8-Elba enterprise, installed on 12-09-2022 (installation code: 18442637ee4274312a), the latest version of DaDaBIK is 11.8-Elba released on 12-05-2022

You are running the latest release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.

System info​


Have a single dropdown box need to use where clause for current group.
PHP Version: 7.4.33

sqlserver version: 16.00.0900

Web server: Microsoft-IIS/10.0

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

URL installation: https://smallbizpc.com/program_files/
----------------------------------------------------------------------------------------------------------------------------
Have a single dropdown box need to use where clause for current group so I can list only the options in the drop down box cooresponding to thar group.

used where field under the list box selections.

[08] Error: during query execution. SELECT "id", "Ticket_type" FROM "Ticket_Type" WHERE (1 = 1) AND (co_id=$_SESSION['logged_user_infos_ar']["id_group"]) ORDER BY "Ticket_type" ASC
The DBMS server said: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid pseudocolumn "$_SESSION".

Thanks
 

eugenio

Administrator
Staff member
Hello,
if you want to use the current group inside the WHERE clause, the correct syntax is

dadabik_var current_id_group dadabik_var

(check the inline help)

Best,
 

D

New member
Ok, thanks, I had read that along with watching spent a few days watching all your videos and still did not understand. I spent days researching this before posting. Guess I am a very slow learner. So I appoligize if you think I do not care enough to read your documents. Speaking of that, the functions documents you said to read, are all blank.

Since you pointed me back to the hint, and gave me the code again, dadabik_var current_id_group dadabik_var I went back to that. I thought the hint dadbik_var was the field name so I replaced dadabik_var with my field co_id. I tried using that using that name at the beginning and the end of current_id_group_user. I then gave up on that and saw where you used $_SESSION['logged_user_infos_ar'] in one of the videos as part of a funtion. I also tried to create a function and return the group_id back, with limited success. Yes I am just that dense.

For the bennefit of others who have issues; The where clause in the single select should look like "co_id(co_id is the field name in the table you the end user created)=dadabik_var current_id_group dadabik_var" . I don't know what dadabik_var is, but suspect it is a hint to the dadabik uses for SQL formatting, just leave it as is, then the system works great.

I think this dadabik app is a great application, and like anything else it gets easier as you learn the foundational construction of the app.

Thanks Eugenio for your help, you helped me nudged my program along. This is a great product, and I am looking forward to the journey of web development using it. I am very appreciative of your help. Very impressed with how quicly you answered my plea for help.

Thanks again.
 

eugenio

Administrator
Staff member
Yes dadabik_var ..MYVAR.. dadabik_var is just a syntax used by dadabik as a "placeholder" to add the value of a global variable (MYVAR in this case) to the where clause. Is it working now?

Anyway, you are very welcome!
 
Top