I am using the code below to insert the username and password to keep thi id and password record
i want the change that if the id and password exist it replace the id and password in the database

$username=$_POST['login'];
$password=$_POST['passwd'];

	$con=mysql_connect('localhost','root','');  //establishing  connection with server  

	mysql_select_db("sql", $con);                  //selecting DataBase
			
	mysql_query("INSERT INTO login (username, password)
	VALUES ('$username', '$password')");

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.