Forum Moderators: coopster

Message Too Old, No Replies

Empty Array - Not really

         

Pico_Train

7:54 am on Jun 20, 2006 (gmt 0)

10+ Year Member



Hey there

I was just wondering if anyone has ever encountered the problem I am having.
I am running a sql query within my php script, which is returning an empty array. The funny thing is, if I echo out the sql query and run it in phpmyadmin, it does in fact return one row. Could anyone shed some light on my situation?

Thanks so much, here's a summary of my code below

function blah($id, $indicator){
$sql = 'SELECT ksi_detail.value
FROM company_saved_ksi_detail ksi_detail
WHERE ksi_detail.saved_ksi_id_fk = '.$id.'
AND ksi_detail.indicator_id_fk = '.$indicator;

$this->dao->fetch($sql);
$temp = $this->getItems();
}

function getItems{
$detail = array();
while ($row=$this->getItem())
{
$detail[] = $row;
}
return $detail;
}

Thanks!

wheelie34

8:53 am on Jun 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



'.$indicator;

at first glance, the end of that line doesnt look right, shouldnt it be

'.$indicator.'';

Pico_Train

9:25 am on Jun 20, 2006 (gmt 0)

10+ Year Member



Thanks Wheelie, we fixed it with that and another tweak.