Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Due to public holidays and vacations, longer response times can be expected for inquiries in the forum between December 20, 2024 and Janaury 8, 2025.

How make a sql query using a text field

More
1 month 21 hours ago #10953 by giamod
[I want to make a sql query  using a text box. I try to explain.  A have a text box containing the username of a joomla user and I want to perform a query on a wisiform database with the same username. I have used a query  like select CONCAT(F37, ' ', F108, ' ',F55) as label, id as value from #__visforms_3  where id = ${input:nume};  where nume is the alias of a text field containg the user name. My goal is exstract from the visform database the name, email ed a date.
But nothing happens. Can you help me?
I use visiform subscription
Molte grazie!

More
1 month 4 hours ago #10958 by Administrator IV
Replied by Administrator IV on topic How make a sql query using a text field
Hello giamod,

your query is:
Code:
select CONCAT(F37, ' ', F108, ' ',F55) as label, id as value from #__visforms_3 where id = ${input:nume};

The WHERE part seems to be wrong.
The field 'id' is an auto-increment of an integer.
You have to enter the correct text field instead of the field 'id'.

I suspect the SQL statement must be something like this.
While I assume that table field 'F37' corresponds to the form field with the alias 'nume':
Code:
select CONCAT(F37, ' ', F108, ' ',F55) as label, id as value from #__visforms_3 where F37 = ${input:nume};

Kind regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
4 weeks 1 day ago #10967 by giamod
Replied by giamod on topic How make a sql query using a text field
You are great! I had yet tried your statement but I received a blank field. I have to set up something in particular? The two fields, nume and ris (as sql result) are textbox, the second with sql statement?

More
4 weeks 1 day ago #10968 by Administrator IV
Replied by Administrator IV on topic How make a sql query using a text field
Hello giamod,

I'm sorry, but I forgot the obligatory single quotes for string literals.
I was so focused on choosing the wrong field.
The text field values ​​are string literals and must be enclosed in single quotes:

... = '${input:nume}' ...

This SQL statement is now at least completely correct and looks very promising.
Code:
select CONCAT(F37, ' ', F108, ' ',F55) as label, id as value from #__visforms_3 where F37 = '${input:nume}';

Maybe it will work now...

When developing SQL statements, a good development environment is important.
Even for tasks that seem simple, like this.

Visforms obviously cannot be a competent development environment at this point.
But we can point out this fact in the documentation and recommend working methods.

Modern text editor or development environment:
docs.joomla-5.visforms.vi-solutions.de/e...elopment-environment

Quote:
We recommend that you write the SQL statement in a good modern text editor or, better still, in a dedicated development environment and test it thoroughly. It is also possible to develop and test the SQL statement in a MySql console, for example.

Quote:
When using the test button for the SQL statement, you must take this fact into account and work with fixed values ​​instead of placeholders.

Best regards, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
4 weeks 1 day ago #10969 by giamod
Replied by giamod on topic How make a sql query using a text field
I reply in italian language: "FUNZIONA!"
Molte grazie, Ingmar!

More
4 weeks 1 day ago #10970 by Administrator IV
Replied by Administrator IV on topic How make a sql query using a text field
Hello giamod,

I'm very happy to hear that.

And especially in your native language!

Now that you've overcome these first hurdles, you'll definitely find even more uses for the SQL fields.

Best wishes, Ingmar

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum