Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

Requete SQL

Mehr
2 Jahre 5 Tage her #8097 von av_74
Requete SQL wurde erstellt von av_74
Hello Aicha I have a field: first name (F166) and a field: Last name (F167)
I would like to combine these 2 fields in a "Select sql" type field but I can't find the right syntax the query only displays the first name
Here is the SQL-Select-Statement query :
SELECT id as value,  F166 as label, F166 as value,  F167 as label, F167 as value FROM `aspt_visforms_6`  ORDER BY F166

Can you help me ?
cordially
Alain

Mehr
2 Jahre 5 Tage her #8098 von Administrator IV
Administrator IV antwortete auf Requete SQL
Hello Alain,

please try this:
select id as value, concat(F166, ' ', F167) as label from aspt_visforms_6 order by F166;

and listen to:
www.w3schools.com/sql/func_mysql_concat.asp

Remarks:
The back ticks ` are only necessary when using reserved words.
The characters upper case is optional and good for readability in more or less large statements;

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 :-).

Mehr
2 Jahre 3 Tage her #8101 von av_74
av_74 antwortete auf Requete SQL
Hello Ingmar
Here is a new request :SELECT CONCAT_WS('F166','F167') as 'F283' FROM aspt_visforms_6

When I click on the test button the message success: found 28 entries appears.
But when I go to the list field of my form, it is empty
Avez vous une solution ?

Best regards
Alain

Mehr
2 Jahre 12 Stunden her - 1 Jahr 11 Monate her #8104 von Administrator IV
Administrator IV antwortete auf Requete SQL
Hello Alain,

The function CONCAT_WS() fits your needs perfectly as to join two or more strings with a separator!
The message 'success: found 28 entries' does tell you that you have a valid select statement which returns a record set having 28 entries.

The test is not looking for this:
But the SQL statement SQL statement must return a value and a label (Visforms Documentation).
This is why the list remains empty.
www.vi-solutions.de/en/documentations/do...m-database-using-sql

Please re-try something like this:
SELECT id as value, CONCAT_WS('F166','F167') as label FROM aspt_visforms_6

This SQL statement gives you a listbox filled with options, which have the recordset id as option values and the 'string-concatenation' (names) as option labels (or visible text).
The option value (the recordset id of the selected name) get saved to the database into the SQL listbox field.

Or re-try something like this:
SELECT CONCAT_WS('F166','F167') as value, CONCAT_WS('F166','F167') as label FROM aspt_visforms_6

This SQL statement gives you a listbox filled with options, which have the  'string-concatenation' (names) as option values and as option labels (or visible text).
The option value (the 'string-concatenation' of the two names) get saved to the database in the SQL listbox field.

As a general note I have to tell you, that some decent experience in writing/understanding SQL select statement is quite helpful.
Nothing else or special (apart from must return a value and a label) goes on here.
Must return a value and a label means, that the statement as to declare the two resulting parts:
'something' as value
'something' as label

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 :-).
Letzte Änderung: 1 Jahr 11 Monate her von Administrator IV.

Mehr
1 Jahr 10 Monate her #8202 von av_74
av_74 antwortete auf Requete SQL
select id as value, concat(F166, ' ', F167) as label from aspt_visforms_6 order by F166;

it works perfectly Thank you
Best regards

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum