Comdemned Posted January 22, 2008 Share Posted January 22, 2008 Hi All, I have a pretty basic mysql update statment that for some reason is not working properley. <?php $query = "INSERT INTO apptype (name, description, timeframe, last_modified) VALUES ('$name', '$description', '$timeframe', '$client_id')"; mysql_query($query, $db); mysql_close($db); ?> Any help would be greatly appricated. Many thanks Murray Link to comment https://forums.phpfreaks.com/topic/87162-mysql-update-statment-not-working/ Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 mysql_query($query, $db) or die (mysql_error()); Link to comment https://forums.phpfreaks.com/topic/87162-mysql-update-statment-not-working/#findComment-445792 Share on other sites More sharing options...
Comdemned Posted January 22, 2008 Author Share Posted January 22, 2008 Sorry I pasted the wrong code. Here is the code that I am having a problem with. <?php $query = "UPDATE apptype SET name='$name', description='$description' timeframe='$timeframe', last_modified='$client_id' WHERE type_id='$id'"; mysql_query($query, $db); ?> Thanks again Link to comment https://forums.phpfreaks.com/topic/87162-mysql-update-statment-not-working/#findComment-445794 Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 Missing a comma here description='$description' And you should still check for query errors like my post above. It would have told you the error. Link to comment https://forums.phpfreaks.com/topic/87162-mysql-update-statment-not-working/#findComment-445800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.