Skip to content

Commit 99cfbfb

Browse files
committed
🔨 bypass dynamic property error
Signed-off-by: otengkwame <[email protected]>
1 parent 6fe6239 commit 99cfbfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Core/helpers/db_helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function use_table($table = '', $model_type = 'EasyModel')
5050
return $model;
5151
}
5252

53-
$model->table = $table;
53+
$model->{'table'} = $table; // bypass dynamic property error
5454

5555
return $model;
5656
}
@@ -151,7 +151,7 @@ function max_id($table, $select_as=null) {
151151
if($select_as != null) {
152152
$maxid = ci()->db->query('SELECT MAX(id) AS '.$select_as.' FROM ' . $table)->row()->$select_as;
153153
} else {
154-
$maxid = ci()->db->query('SELECT MAX(id) AS biggest FROM '. $table)->row();
154+
$maxid = ci()->db->query('SELECT MAX(id) AS biggest FROM '. $table)->row()->biggest;
155155
}
156156

157157
return $maxid;

0 commit comments

Comments
 (0)