Fixing query

skala
Julio Montoya 13 years ago
parent 46feac9742
commit a37eef7345
  1. 8
      main/inc/lib/document.lib.php

@ -797,11 +797,11 @@ class DocumentManager {
} }
if (!empty($document_id)) { if (!empty($document_id)) {
$sql= 'SELECT a.insert_user_id, b.readonly FROM '.$TABLE_PROPERTY.' a,'.$TABLE_DOCUMENT.' b $sql= "SELECT a.insert_user_id, b.readonly FROM $TABLE_PROPERTY a, $TABLE_DOCUMENT b
WHERE WHERE
a.c_id = $course_id AND a.c_id = $course_id AND
b.c_id = $course_id AND b.c_id = $course_id AND
a.ref = b.id and a.ref='.$document_id.' LIMIT 1'; a.ref = b.id and a.ref= $document_id LIMIT 1";
$resultans = Database::query($sql); $resultans = Database::query($sql);
$doc_details = Database ::fetch_array($resultans, 'ASSOC'); $doc_details = Database ::fetch_array($resultans, 'ASSOC');
@ -1306,7 +1306,7 @@ class DocumentManager {
} }
$sql='UPDATE '.$tbl_category.' SET document_id="'.Database::escape_string($document_id).'" $sql='UPDATE '.$tbl_category.' SET document_id="'.Database::escape_string($document_id).'"
WHERE course_code="'.Database::escape_string($course_id).'" '.$sql_session; WHERE course_code="'.Database::escape_string($course_id).'" '.$sql_session;
$rs=Database::query($sql); Database::query($sql);
} }
/** /**
@ -1472,7 +1472,7 @@ class DocumentManager {
$sql='UPDATE '.$tbl_category.' SET document_id=null $sql='UPDATE '.$tbl_category.' SET document_id=null
WHERE course_code="'.Database::escape_string($course_id).'" AND document_id="'.$default_certificate_id.'" '.$sql_session; WHERE course_code="'.Database::escape_string($course_id).'" AND document_id="'.$default_certificate_id.'" '.$sql_session;
$rs=Database::query($sql); Database::query($sql);
} }
} }

Loading…
Cancel
Save