# help me with update records in mysql database

**URL:** https://forums.percona.com/t/help-me-with-update-records-in-mysql-database/3930
**Category:** Other MySQL® Questions
**Created:** [December 3, 2014, 10:16pm UTC](https://forums.percona.com/t/help-me-with-update-records-in-mysql-database/3930 "2014-12-03T22:16:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tyrone99](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tyrone99](https://forums.percona.com/u/tyrone99)
#### Post date: [December 3, 2014, 10:16pm UTC](https://forums.percona.com/t/help-me-with-update-records-in-mysql-database/3930/1 "2014-12-03T22:16:58Z")

</div>

[COLOR=#5A5A5A]

Look, my update.php is like this now  
[COLOR=#FF0000]\<?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](https://ads.digitalpoint.com/go.php?k=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]

---

<div class="post-metadata">

### Author: ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)
#### Post date: [December 4, 2014, 11:03am UTC](https://forums.percona.com/t/help-me-with-update-records-in-mysql-database/3930/2 "2014-12-04T11:03:23Z")

</div>

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:

[url][http://www.w3schools.com/php/php\_forms.asp[/url]](http://www.w3schools.com/php/php_forms.asp%5B/url%5D)

-Scott
