# Simple PHP Update, isn't working

**URL:** <https://forum.kirupa.com/t/simple-php-update-isnt-working/309544>\
**Category:** programming\
**Created:** [May 18, 2010, 2:22pm UTC](https://forum.kirupa.com/t/simple-php-update-isnt-working/309544 "2010-05-18T14:22:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flux](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flux/32/1418_2.png) [@Flux](https://forum.kirupa.com/u/Flux)\
**Post date:** [May 18, 2010, 2:22pm UTC](https://forum.kirupa.com/t/simple-php-update-isnt-working/309544/1 "2010-05-18T14:22:35Z")

</div>

Cant figure out why this isn’t working. Any help please

```php

<?php

include("db_connect.php");

$id= $_POST['id_update'];
$hostname= $_POST['hostname_update'];
$mac= $_POST['mac_update'];
$type= $_POST['type_update'];
$ad_joined= $_POST['ad_joined_update'];

$result = mysql_query("UPDATE devices SET hostname='" . $_POST['hostname'] . "', ip='" . $_POST['ip'] . "', mac='" . $_POST['mac'] . "', type='" . $_POST['type'] . "', ad_joined='" . $_POST['ad_joined'] . "' WHERE id='" . $_POST['id'] . "'");
$row = mysql_query($result);

echo "Record updated! </br>";
echo "Redirecting to inventory...";

?>

```

The form has the above set, upon submitting form which uses the above to process, it gives no error but seems to remove details and not add.
