Community Support for OpenDocMan (Deprecated)

Full Version: 1.2.5.5 - check-in.php - SQL error upon check-in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
Index: check-in.php
===================================================================
--- check-in.php    (revision 658)
+++ check-in.php    (working copy)
@@ -219,7 +219,7 @@
        $result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
        list($username) = mysql_fetch_row($result);
        // update revision log
-        $query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision={($lrevision_num - 1)} WHERE id = {$_POST['id']} and revision = 'current'";
+        $query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}log set revision='($lrevision_num - 1)' WHERE id = {$_POST['id']} and revision = 'current'";
        mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
        $query = "INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}log (id, modified_on, modified_by, note, revision) VALUES('$_POST[id]', NOW(), '" . addslashes($username) . "', '". addslashes($_POST['note']) ."', 'current')";
        $result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());