Skip to content

Commit c67b26b

Browse files
committed
Add global reference to db connection object.
1 parent 72724a4 commit c67b26b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/schedule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ function generateIcal($schedule) {
103103
}
104104

105105
function getScheduleFromId($id) {
106+
global $dbConn;
107+
106108
// Query to see if the id exists, if we can update the last accessed time,
107109
// then the id most definitely exists.
108110
$query = "UPDATE schedules SET datelastaccessed = NOW() WHERE id={$id}";
@@ -170,6 +172,8 @@ function getScheduleFromId($id) {
170172
}
171173

172174
function getScheduleFromOldId($id) {
175+
global $dbConn;
176+
173177
$query = "SELECT id FROM schedules WHERE oldid = '{$id}'";
174178
$result = $dbConn->query($query);
175179
if(!$result || $result->num_rows != 1) {

0 commit comments

Comments
 (0)