Ich frage mich, ob es eine Möglichkeit gibt, CodeIgniter zu verwenden und einen Ausgangspunkt für das „Limit“ anzugeben, das das tatsächliche Datum sein sollte.
Code: Select all
function graph_data($id_person)
{
$this->db->limit(30); // get data for the last 30 days including the current day
$this->db->where('personid', $id_person);
$this->db->order_by('date', 'ase');
$query = $this->db->get('stats');
foreach ($query-> result_array() as $row) {
$data[] = $row;
}
return $data;
}
Mobile version