mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added "0" if table is empty (obtaining last max-value)
This commit is contained in:
@@ -62,6 +62,6 @@ class Migration_harmonize_keys extends CI_Migration {
|
||||
function get_max_from_tbl($tbl,$col) {
|
||||
$query = $this->db->query("select max(".$col.") as MAXI from ".$tbl.";");
|
||||
$row = $query->row();
|
||||
return $row->MAXI;
|
||||
return $row->MAXI ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user