Community Support for OpenDocMan
1.2.5.5 - check-in.php - SQL error upon check-in - Printable Version

+- Community Support for OpenDocMan (https://forum.opendocman.com)
+-- Forum: OpenDocMan Community Discussion (https://forum.opendocman.com/forum-5.html)
+--- Forum: OpenDocMan Patches (https://forum.opendocman.com/forum-10.html)
+--- Thread: 1.2.5.5 - check-in.php - SQL error upon check-in (/thread-182.html)



1.2.5.5 - check-in.php - SQL error upon check-in - Stephen - 02-17-2010

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());