Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
multiple select with 3 values for each option to SQL send

I have a very tricky question and I should work long hours on this problem and look for a solution.

Suppose I have a multiple select and there are more options, each option has 3 values:

  • one value for the language name
  • one is a link to the language icon (img)
  • one is the language level.

in database "SQL" i have 4 columns

    1. id
    1. sprachename
  • 3.spracheicon
  • 4.sprachlevel

If I have a language then select 3 values should be in different columns in MYSQL (language name value should be in language name column and the link value should also be in its own column, etc.)

So how could I do that?

<select
  class="multi-select" 
  name=""
  id=""
  multiple
  v-model="sprachen"
>
  <option 
    value="Arabic"
    value="Muttersprache" 
    value="https://bilder.pcwelt.de/4204696_620x310_r.jpg" 
  >
    Arabisch
  </option>
  <option 
    value="Englisch" 
    value="B1" 
    value="https://bilder.pcwelt.de/4204696_620x310_r.jpg" 
  >
    Englisch
  </option>
</select>


about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can't do it like that I see 2 possible solutions

1 JSON

      <select class="multi-select" name=""
    id=""
    multiple
    v-model="sprachen">
    <option  value='{language:"Arabic", level: "Muttersprache", image: "https://bilder.pcwelt.de/4204696_620x310_r.jpg"}' >Arabisch</option>
   ...
  </select>

2 comma separated value

  <select class="multi-select" name=""
    id=""
    multiple
    v-model="sprachen">
    <option  value='Arabic,Muttersprache,https://bilder.pcwelt.de/4204696_620x310_r.jpg' >Arabisch</option>
   ...
  </select>
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can't have multiple value attributes in one option. Only one value can be submitted.

It seems you're looking to be able to support different variations of the main options, e.g.

Arabic - mother tongue
Arabic - Level B1
English - mother tongue
English - Level B1

or something similar, and were hoping that you could control this by setting multiple values on each option.

A standard approach to this kind of thing is as follows:

  1. Define a table in your database which lists all the possible options and their attributes, and acts as a reference from which you can populate your select. Crucially it also has a unique ID for each row, to identify that option specifically.

e.g. You would have a LanguageOptions table. A few rows of the contents would look like this:

ID Description Lang Level Image
1 Arabic - mother tongue AR M https://bilder.pcwelt.de/4204696_620x310_r.jpg
2 Arabic - Level B1 AR B1 https://example.com/1.jpg
3 English - mother tongue EN M https://example.com/2.jpg
4 English - Level B1 EN B1 https://example.com/3.jpg
  1. This means in your <select> you can use the ID from this table to identify which language option is chosen:

    Arabic - mother tongue Arabic - Level B1 English - mother tongue English - Level B1
  2. So then when the form is submitted and the values sent back to the server, you can record which option IDs the user chose by using that single value, and later if you want to output the descriptions against somewhere else, you can JOIN the LanguageOptions table to the User options table using SQL.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda