Select from mysql databases

Moderator: crythias

Post Reply
denionzz
Znuny newbie
Posts: 8
Joined: 18 Jan 2016, 11:24
Znuny Version: 3.3.8

Select from mysql databases

Post by denionzz »

You must make a request to the database and display the result on the form in the required field. After reading the documentation I came to the conclusion that it is necessary to use jquery + ajax + perl. Embed code in the template file, but the result will not be displayed. Prompt please, move and how it can be realized which way? Maybe there is another way?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Select from mysql databases

Post by reneeb »

??? Please provide more details! What do you want to achieve?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
denionzz
Znuny newbie
Posts: 8
Joined: 18 Jan 2016, 11:24
Znuny Version: 3.3.8

Re: Select from mysql databases

Post by denionzz »

There FIELD1 field.
I enter a value. I press the FIND button.
In the field of FIELD2, FIELD3 selected values on request "Select first_name,last_name from users WHERE id=FIELD1"
nd0
Znuny expert
Posts: 232
Joined: 24 Mar 2015, 16:53
Znuny Version: 5.0.14
Location: Colonia

Re: Select from mysql databases

Post by nd0 »

Maybe you should try to write down your question in your native language...

Afterwards use https://translate.google.com and copy/paste the result :?
LIVE: OTRS 5.0.14 || Debian || MySQL/LDAP
TEST: OTRS 5.0.14 || Debian || MySQL/LDAP
denionzz
Znuny newbie
Posts: 8
Joined: 18 Jan 2016, 11:24
Znuny Version: 3.3.8

Re: Select from mysql databases

Post by denionzz »

I try :)
1. I have added a new table in the database OTRS
2. I would like to request to select data from a table on the form of the creation of the ticket
To do this, you need to write a new module? How to do it right and just?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Select from mysql databases

Post by reneeb »

So you have a new table and you want to display its values in the ticket creation form. Correct?

Do you want to store the selected value in the ticket?
Do the shown values depend on other information (e.g. selected queue)?
Do you need to access the table elsewhere (other forms, ticket zoom, ...)?
...

If you want to store the selected value in the ticket, you might use a dynamic field.... Install http://opar.perl-services.de/dist/DynamicFieldRemoteDB, then create a new dynamic field for the ticket. It should have the type RemoteDB. Configure the access to your table. Activate the new dynamic field for the ticket creation forms (AgentTicketPhone and AgentTicketEmail) and the ticket zoom.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
denionzz
Znuny newbie
Posts: 8
Joined: 18 Jan 2016, 11:24
Znuny Version: 3.3.8

Re: Select from mysql databases

Post by denionzz »

reneeb wrote:So you have a new table and you want to display its values in the ticket creation form. Correct?
Yes, yes,yes... :)
reneeb wrote:Do you want to store the selected value in the ticket?
Oh sure! They will be saved along with the ticket.
reneeb wrote:Do the shown values depend on other information (e.g. selected queue)?
Yes! This is the main problem. The condition for the request can be any value. For example, I type the number 1 and get information on my table where the ID field is set to 1 at the right field to me.
denionzz
Znuny newbie
Posts: 8
Joined: 18 Jan 2016, 11:24
Znuny Version: 3.3.8

Re: Select from mysql databases

Post by denionzz »

I installed DinamichFildRemoteDB.
Excellent work, the information is taken from the database and inserted into the field. But what if you need to select more than one value at once a search? Insert the result into the table?
Post Reply