Refactor setup_model.php to bindings

This commit is contained in:
int2001
2025-12-30 08:07:41 +00:00
parent 1211c2319f
commit e89268a4ca

View File

@@ -11,16 +11,16 @@ class Setup_model extends CI_Model {
function getLogbookCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'SELECT count(*) as count FROM station_logbooks WHERE user_id =' . $userid;
$query = $this->db->query($sql);
$sql = 'SELECT count(*) as count FROM station_logbooks WHERE user_id = ?';
$query = $this->db->query($sql, $userid);
return $query->row()->count;
}
function getLocationCount() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = 'SELECT count(*) as count FROM station_profile WHERE user_id =' . $userid;
$query = $this->db->query($sql);
$sql = 'SELECT count(*) as count FROM station_profile WHERE user_id = ?';
$query = $this->db->query($sql, $userid);
return $query->row()->count;
}