# Is my update syntax correct in my php code?

**URL:** https://forum.kirupa.com/t/is-my-update-syntax-correct-in-my-php-code/82703
**Category:** programming
**Created:** [March 12, 2005, 2:55pm UTC](https://forum.kirupa.com/t/is-my-update-syntax-correct-in-my-php-code/82703 "2005-03-12T14:55:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![FlashNewby](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@FlashNewby](https://forum.kirupa.com/u/FlashNewby)
#### Post date: [March 12, 2005, 2:55pm UTC](https://forum.kirupa.com/t/is-my-update-syntax-correct-in-my-php-code/82703/1 "2005-03-12T14:55:33Z")

</div>

I can’t believe I’m having such a hard time with this but, I’m trying to update code in my database using php here is the code. I don’t see any issues, I mean I have a php mysql book in front of me and it looks correct:

```php
 
$sql = "UPDATE info SET firstname='$fn' WHERE user_id='$user'";
$Result2 = mysql_query($sql, $dbConnect) or die('Error updating database. Error L1.');

```

What could be the fricking problem! I’ve wasted so much time on this simple piece of code.

I’m connecting fine because before this line I’m doing a select statement which works. I’m using the same mysql\_select\_db().

I’ve also printed out the values for **$fn** and\*\* $user\*\* and they both have data.

Thanks
