Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Collegare due oggetti di un form e mandarli su MySQL

    Ho vari campi in un form accoppiato così:

    textfield1 e select1
    textfield2 e select2
    textfield3 e select3
    textfield4 e select4

    ecc.

    Vorrei nel db MySQL settare nel campo che ha per "nick" texfield (1,2,3 e 4) il campo "numero" uguale a select (1,2,3 e 4)

    cioé
    nick: textfield1 avrà come numero: select1
    nick: textfield2 avrà come numero: select2

    devo utilizzare un ciclo "for"?
    Come?



    Grazie!
    GdR Online - http://lenar.it/
    Yesterday is history. Tomorrow is mystery.
    Today is a gift. That's why it's called the present

  2. #2
    non ho capito cosa vorresti fare.

  3. #3
    for ($a=1;$a<=$max;$a++) {
    $textfield = 'textfield'.$a;
    $select = 'select'.$a;
    mysql_query("INSERT INTO tabella (".$$textfield.") VALUES ('".$$select."')",$db);
    }
    ma devi mettere nel form in fondo un
    <input type=hidden name=max value=NUMERO_MASSIMO_USATO>
    visitate http://camicio.altervista.org per caxxate varie :d

  4. #4
    $max potrei anche passarlo per lurl e riprenderlo con $_GET['max'].
    Non ho capito quel (".$$textfield.").
    Grazzzie!!
    GdR Online - http://lenar.it/
    Yesterday is history. Tomorrow is mystery.
    Today is a gift. That's why it's called the present

  5. #5
    capito capito, ora provo e poi se non gira riposto
    GdR Online - http://lenar.it/
    Yesterday is history. Tomorrow is mystery.
    Today is a gift. That's why it's called the present

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.