Added "0" if table is empty (obtaining last max-value)

This commit is contained in:
int2001
2024-03-02 10:54:44 +00:00
parent b84694f531
commit 2c2e88c8fe

View File

@@ -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;
}
}