# Help with this Update record code

**URL:** <https://forum.kirupa.com/t/help-with-this-update-record-code/191971>\
**Category:** programming\
**Created:** [June 24, 2006, 3:19pm UTC](https://forum.kirupa.com/t/help-with-this-update-record-code/191971 "2006-06-24T15:19:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onemhunki](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@onemhunki](https://forum.kirupa.com/u/onemhunki)\
**Post date:** [June 24, 2006, 3:19pm UTC](https://forum.kirupa.com/t/help-with-this-update-record-code/191971/1 "2006-06-24T15:19:55Z")

</div>

Folks,

I have a simple content management system, I’ve got the data into my form for editing, edit the data then pass it to this php script, however it doesn’t seem to update the record, any ideas?

```php

$id=$_POST['newsID'];
$name=$_POST['newsTitle'];
$newsdate="{$_POST['year']}-{$_POST['month']}-{$_POST['day']}";
$expdate="{$_POST['year2']}-{$_POST['month2']}-{$_POST['day2']}";
$bulletin=$_POST['newsBulletin'];
$linktext=$_POST['newsLinktext'];
$link=$_POST['newsLink'];
$body=$_POST['newsBody'];

$query="UPDATE news SET newsTitle='$name', newsDate='$newsdate', newsExpirydate='$expdate', newsBulletin='$bulletin', newsLinktext='$linktext', newsLink='$link', WHERE newsID='$newsID'";
mysql_query($query);
echo "Updating records $name $id";
mysql_close();

```
