Jump to content
alexarpad2003

mysql

Recommended Posts

Posted

Vreau sa fac update la campul "parola" din tabel1 cu valoarea din campul "parola"

din tabel2 unde au id-ul comun.

Am incercat :

mysql_query("UPDATE tabel1 SET parola=tabel2.parola FROM tabel2 WHERE tabel1=parole.id");

Dar nu merge.

Posted

Hm poate am o logica proasta. Deci ideea este ca am un form cu cateva inputuri

si le bag in baza de date cu un querry INSERT INTO. Asta e verificat si merge, insa dupa acest querry mai am inca unul care ar trebui sa-mi ia valori din alt tabel si sa le bage in asta.

Se poate INSERT INTO iar pe randul urmator UPDATE ?

Posted

$sql="INSERT INTO $tbl_name (confirm_code, name, prenume, email, user, parola, country)

VALUES('$confirm_code', '$name', '$prenume', '$email', '$user', '$parola', '$country');

UPDATE $tbl_name SET parola=(SELECT parola FROM parole where id=id)";

Nu vrea.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...