help me with update records in mysql database


Look, my update.php is like this now
$servername = “localhost”;
$username = “root”;
$password = “…”;
$dbname = “webtest”;

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);

$sql = “UPDATE users SET password=‘cotton candy’ WHERE id=10”;

if ($conn->query($sql) === TRUE) {
echo “Record updated successfully”;
} else {
echo "Error updating record: " . $conn->error;

but now i have still have to go into the php file to change the valeu or the id
but i looked on site and youtube how to put it in a simple html form
but it still does not work.

i want it in a html from.
I want that when I enter the ID that the data of the user appears and that I can change any valeu separately.[/INDENT]

Hi tyrone99;

I would recommend reading through some basic PHP/HTML tutorials. It looks like you have the PHP/MySQL portion working, so you just need to learn how to pass information from an HTML form into your PHP script: