kopia lustrzana https://github.com/magicbug/Cloudlog
count rows returns 1 even with 0 as result ...
rodzic
475820d09b
commit
5b7a31fe11
|
@ -3,32 +3,26 @@
|
||||||
class Setup_model extends CI_Model {
|
class Setup_model extends CI_Model {
|
||||||
|
|
||||||
function getCountryCount() {
|
function getCountryCount() {
|
||||||
$sql = 'select count(*) from dxcc_entities';
|
$sql = 'select count(*) as count from dxcc_entities';
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
$result = $query->result();
|
return $query->row()->count;
|
||||||
|
|
||||||
return count($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLogbookCount() {
|
function getLogbookCount() {
|
||||||
$userid = xss_clean($this->session->userdata('user_id'));
|
$userid = xss_clean($this->session->userdata('user_id'));
|
||||||
$sql = 'select count(*) from station_logbooks where user_id =' . $userid;
|
$sql = 'select count(*) as count from station_logbooks where user_id =' . $userid;
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
$result = $query->result();
|
return $query->row()->count;
|
||||||
|
|
||||||
return count($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLocationCount() {
|
function getLocationCount() {
|
||||||
$userid = xss_clean($this->session->userdata('user_id'));
|
$userid = xss_clean($this->session->userdata('user_id'));
|
||||||
$sql = 'select count(*) from station_profile where user_id =' . $userid;
|
$sql = 'select count(*) as count from station_profile where user_id =' . $userid;
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
$result = $query->result();
|
return $query->row()->count;
|
||||||
|
|
||||||
return count($result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue