Toon posts:

[MySQL] Meedere waarden updaten

Pagina: 1
Acties:
  • 28 views sinds 30-01-2008

Verwijderd

Topicstarter
eerst voeg ik een klant toe met behulp van de volgende MySQL Query onder PHP :

"INSERT INTO customers (username, password, mail, gender, name1, name2, name3, street1, street2, postal1, postal2, place, phone1, phone2, activated, activation) VALUES ('".$_SESSION[post][username]."', '".$_SESSION[post][password1]."', '".$_SESSION[post][mail]."', '".$_SESSION[post][gender]."', '".$_SESSION[post][name1]."', '".$_SESSION[post][name2]."', '".$_SESSION[post][name3]."', '".$_SESSION[post][street1]."', '".$_SESSION[post][street2]."', '".$_SESSION[post][postal1]."', '".$_SESSION[post][postal2]."', '".$_SESSION[post][place]."', '".$_SESSION[post][phone1]."', '".$_SESSION[post][phone2]."', 'no', '".$actcode."')"

en als ik al die velden wil laten aanpassen. hoe ziet mijn mysql querty er dan uit ?

"UPDATE customers .....????

  • P_de_B
  • Registratie: Juli 2003
  • Niet online

Oops! Google Chrome could not find www.rijks%20museum.nl


Verwijderd

Oei, erg basic...

code:
1
UPDATE tabel SET veld1='iets',veld2='dit',veld3='wie?' WHERE iets=1

  • Robtimus
  • Registratie: November 2002
  • Laatst online: 11:06

Robtimus

me Robtimus no like you

Verwijderd schreef op 24 augustus 2004 @ 16:00:
eerst voeg ik een klant toe met behulp van de volgende MySQL Query onder PHP :

"INSERT INTO customers (username, password, mail, gender, name1, name2, name3, street1, street2, postal1, postal2, place, phone1, phone2, activated, activation) VALUES ('".$_SESSION[post][username]."', '".$_SESSION[post][password1]."', '".$_SESSION[post][mail]."', '".$_SESSION[post][gender]."', '".$_SESSION[post][name1]."', '".$_SESSION[post][name2]."', '".$_SESSION[post][name3]."', '".$_SESSION[post][street1]."', '".$_SESSION[post][street2]."', '".$_SESSION[post][postal1]."', '".$_SESSION[post][postal2]."', '".$_SESSION[post][place]."', '".$_SESSION[post][phone1]."', '".$_SESSION[post][phone2]."', 'no', '".$actcode."')"

en als ik al die velden wil laten aanpassen. hoe ziet mijn mysql querty er dan uit ?

"UPDATE customers .....????
Ik neem aan dat username uniek is.
Dan wordt het iets als:
SQL:
1
"UPDATE customers SET name1 = ".$_SESSION[name1]. " ..... WHERE user = ".$_SESSION[user]

More than meets the eye
There is no I in TEAM... but there is ME
system specs


  • gorgi_19
  • Registratie: Mei 2002
  • Nu online

gorgi_19

Kruimeltjes zijn weer op :9

Zie de handleiding (en P_de_B voor een verwijzing) :)

Digitaal onderwijsmateriaal, leermateriaal voor hbo


Dit topic is gesloten.