# \[PHP/MySQL\]Where am I wrong?

**URL:** <https://forum.kirupa.com/t/php-mysql-where-am-i-wrong/210545>\
**Category:** programming\
**Created:** [December 19, 2006, 9:38pm UTC](https://forum.kirupa.com/t/php-mysql-where-am-i-wrong/210545 "2006-12-19T21:38:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evildrummer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/evildrummer/32/2308_2.png) [@evildrummer](https://forum.kirupa.com/u/evildrummer)\
**Post date:** [December 19, 2006, 9:38pm UTC](https://forum.kirupa.com/t/php-mysql-where-am-i-wrong/210545/1 "2006-12-19T21:38:13Z")

</div>

Ok here is the code I have so far, or atleast parts of it, I am not sure where I am going wrong, any help would be nice.

```php

<?php
mysql_connect('host','username','password);
@mysql_select_db('database') or die( "Unable to select database");
$maindata=$_POST['mc'];
$aboutdata=$_POST['ac'];
$catdata=$_POST['cc'];
$spondata=$_POST['sc'];
$querymain = "UPDATE `data` SET `content` = '$maindata', `postdate` = \'2006-12-16 02:41:23\' WHERE `id` = 1 LIMIT 1;";
$queryabout = "UPDATE `data` SET `content` = '$aboutdata', `postdate` = \'2006-12-16 02:41:23\' WHERE `id` = 2 LIMIT 1;";
$querycat = "UPDATE `data` SET `content` = '$catdata', `postdate` = \'2006-12-16 02:41:23\' WHERE `id` = 3 LIMIT 1;";
$queryspon = "UPDATE `data` SET `content` = '$spondata', `postdate` = \'2006-12-16 02:41:23\' WHERE `id` = 4 LIMIT 1;";
mysql_query($querymain);
mysql_query($queryabout);
mysql_query($querycat);
mysql_query($queryspon);
mysql_close();
?>

```

I have have changed the username, host, password and database name for security other than that thats basically the main code, any ideas?
