So I have follow code. Which replace username "333" to "reer" in database.
But I'm kinda lost how to make this code working follow method:
There is field box where typing user's current username and second field where type new user's username and then just submit. If someone have time to help me I appreciate it very much.
Code:
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
mysql_query("UPDATE users SET username='reer'
WHERE username='333'");
mysql_close($con);
?>