# PHP: problem updating mysql database

**URL:** <https://forum.kirupa.com/t/php-problem-updating-mysql-database/294794>\
**Category:** programming\
**Created:** [August 20, 2009, 12:43am UTC](https://forum.kirupa.com/t/php-problem-updating-mysql-database/294794 "2009-08-20T00:43:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mung](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@mung](https://forum.kirupa.com/u/mung)\
**Post date:** [August 20, 2009, 12:43am UTC](https://forum.kirupa.com/t/php-problem-updating-mysql-database/294794/1 "2009-08-20T00:43:43Z")

</div>

hi all,  
basically ive integrated the update.php into a page callef requestdetails.php, everything looks fine regarding the code, ive tried 3 hours of trial and error, chopping and changing and i keep getting an error everytime:

\*(“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘desc=‘this is the code typed in from the textbox’ WHERE uploadid=‘5’’ at line 1”)

\*Heres my code (connect to database is included in header, it connects because error message is showing results:  
\*  
\<?php

if (isset($\_POST[‘Submit’])){

$newdesc = $\_POST[‘description’];  
$upid = $\_POST[‘up\_id’];

$editdesc = mysql\_query(“UPDATE uploadref SET desc=’” . mysql\_real\_escape\_string($newdesc) . “’ WHERE uploadid=’$upid’”)  
or die(mysql\_error());  
if ($editdesc){  
$success\_msg = ‘\<font color="#009900"\>Your About section has been updated.\</font\>’;  
} else {  
$error\_msg = ‘\<font color="#FF0000"\>Problems connecting to server, please try again later.\</font\>’;  
}

}  
?\>\*

[LEFT]\*\*Pleasee please can someone help me on this, im goin to put my pc into intensive care ahah!  
Thanks  
\*\*[/LEFT]
