Fix db issues in buy_course plugin - refs #7563

1.10.x
Yannick Warnier 10 years ago
parent d27f89ba8e
commit aad2bca3c1
  1. 4
      plugin/buycourses/database.php
  2. 10
      plugin/buycourses/src/buy_course.lib.php
  3. 5
      plugin/buycourses/src/function.php

@ -65,8 +65,8 @@ $sql = "CREATE TABLE IF NOT EXISTS $table (
sync int)";
Database::query($sql);
$tableSessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$sql = "SELECT * FROM $tableSessionCourse";
$table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$sql = "SELECT * FROM $table";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$presql = "INSERT INTO $table (session_id, c_id, nbr_users)

@ -179,7 +179,7 @@ function userSessionList()
$sql = "SELECT lastname, firstname
FROM course_rel_user a, user b
WHERE a.c_id='" . $row['id'] . "'
AND a.role<>'' AND a.role<>'NULL'
AND a.status <> 6
AND a.user_id=b.id;";
$tmp = Database::query($sql);
$rowTmp = Database::fetch_assoc($tmp);
@ -255,8 +255,7 @@ function userCourseList()
FROM $tableCourseRelUser a, user b
WHERE
a.c_id='" . $row['id'] . "' AND
a.role<>'' AND
a.role<>'NULL' AND
a.status <> 6 AND
a.user_id=b.user_id;";
$tmp = Database::query($sql);
$rowTmp = Database::fetch_assoc($tmp);
@ -507,7 +506,7 @@ function sessionInfo($code)
$sql = "SELECT lastname, firstname
FROM course_rel_user a, user b
WHERE a.c_id='".$row['id']."'
AND a.role<>'' AND a.role<>'NULL'
AND a.status <> 6
AND a.user_id=b.id;";
$tmp = Database::query($sql);
$rowTmp = Database::fetch_assoc($tmp);
@ -579,8 +578,7 @@ function courseInfo($code)
FROM $tableCourseRelUser a, $tableUser b
WHERE
a.c_id = '" . $row['id'] . "' AND
a.role <> '' AND
a.role <> 'NULL' AND
a.status <> 6 AND
a.user_id = b.user_id;";
$tmp = Database::query($sql);
$rowTmp = Database::fetch_assoc($tmp);

@ -101,7 +101,7 @@ if ($_REQUEST['tab'] == 'sessions_filter') {
$sql = "SELECT lastname, firstname
FROM course_rel_user a, user b
WHERE a.c_id=" . $row['id'] . "
AND a.role<>'' AND a.role<>'NULL'
AND a.status <> 6
AND a.user_id=b.id;";
$tmp = Database::query($sql);
$rowTmp = Database::fetch_assoc($tmp);
@ -265,8 +265,7 @@ if ($_REQUEST['tab'] == 'courses_filter') {
$sql = "SELECT lastname, firstname
FROM $tableCourseRelUser a, $tableUser b
WHERE a.c_id = " . $row['id'] . "
AND a.role <> ''
AND a.role IS NOT NULL
AND a.status <> 6
AND a.user_id = b.id;";
$tmp = Database::query($sql);

Loading…
Cancel
Save