Permalink
Browse files

More small sql tweaks to avoid invalid postgres sql

  • Loading branch information...
mjollnir_
mjollnir_ committed Nov 23, 2004
1 parent 4eebe5e commit 68d69eb0965dec271316d2cab2a8a28110a542bb
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/datalib.php
  2. +2 −2 mod/chat/report.php
View
@@ -2393,10 +2393,10 @@ function get_logs_usercourse($userid, $courseid, $coursestart) {
$courseselect = '';
}
- return get_records_sql("SELECT floor((`time` - $coursestart)/86400) as day, count(*) as num
+ return get_records_sql("SELECT floor((time - $coursestart)/86400) as day, count(*) as num
FROM {$CFG->prefix}log
WHERE userid = '$userid'
- AND `time` > '$coursestart' $courseselect
+ AND time > '$coursestart' $courseselect
GROUP BY day ");
}
@@ -2416,10 +2416,10 @@ function get_logs_userday($userid, $courseid, $daystart) {
$courseselect = '';
}
- return get_records_sql("SELECT floor((`time` - $daystart)/3600) as hour, count(*) as num
+ return get_records_sql("SELECT floor((time - $daystart)/3600) as hour, count(*) as num
FROM {$CFG->prefix}log
WHERE userid = '$userid'
- AND `time` > '$daystart' $courseselect
+ AND time > '$daystart' $courseselect
GROUP BY hour ");
}
View
@@ -44,7 +44,7 @@
if ($start and $end and !$confirmdelete) { // Show a full transcript
- if ($groupid) {
+ if (!empty($groupid)) {
$groupselect = " AND groupid = '$currentgroup'";
$groupparam = "&groupid=$currentgroup";
} else {
@@ -106,7 +106,7 @@
$currentgroup = false;
}
- if ($currentgroup) {
+ if (!empty($currentgroup)) {
$groupselect = " AND groupid = '$currentgroup'";
$groupparam = "&groupid=$currentgroup";
} else {

0 comments on commit 68d69eb

Please sign in to comment.