[eluser]Jan_1[/eluser]
Seems that I won't learn some things...
What do I have to change? I'm getting an error 'undefined index'.
Could somebody tell me why? That would be great. Thank you!!!
Code:
function get_kassenmonate($wg)
{
$list = array(
'name' => 'jan', 'where' => array('ks_datum >=' => '2010-01-01', 'ks_datum =<' => '2010-01-31'),
'name' => 'feb', 'where' => array('ks_datum >=' => '2010-02-01', 'ks_datum =<' => '2010-02-28'),
'name' => 'mrz', 'where' => array('ks_datum >=' => '2010-03-01', 'ks_datum =<' => '2010-03-31'),
'name' => 'apr', 'where' => array('ks_datum >=' => '2010-04-01', 'ks_datum =<' => '2010-04-30')
);
foreach ($list as $step)
{
$this->db->select('SUM(ks_betrag) as betrag',FALSE);
$sql = $this->db->get('ks_buchung', $step['where'], FALSE); //<-- Undefined index: where
if ($sql->num_rows() > 0) { $row = $sql->row();
$step['name'] = $row->betrag;}
else { $step['name'] = 0; };
echo $step['name']."<br>";
}
also if $sql-string is without 'FALSE'
Or how could I find out?