Not the answer you need?
Register and ask your own question!

help me with update records in mysql database

tyrone99tyrone99 EntrantCurrent User Role Beginner





























Look, my update.php is like this now
<?php
$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;
}

$conn->close();
?>
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]

Comments

  • scott.nemesscott.nemes MySQL Sage Current User Role Patron
    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:

    http://www.w3schools.com/php/php_forms.asp

    -Scott
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.