Thread: Real issues
View Single Post
  #1 (permalink)  
Old 04-09-2008, 03:14 PM
Ukuser26 Ukuser26 is offline
Junior Member
 
Join Date: Apr 2008
Posts: 5
Default Real issues

Hi Folks,

I'm experiencing real issues here.

class searchAll{

function __construct($dbIn,$post){
$this->db = $dbIn;
$this->post = $post;
}

private function allowedImages($cid){
$db = $this->db;

$sub_sel = $db->select()
QUERY WORKS OK
$te = $sql->__toString();
$tf = $db->query($te); // issue has to be db??
print "$te<br>----<br>$tf<hr>";
}

public function imageSearch(){
$db = $this->db;

$search = $db->select()
QUERY WORKS CORRECT

$search = $db->query($search);

while ($row = $search->fetch())
{
$cid = $row['Company_ID'];
$tr = $this->allowedImages($cid);
print "$cid-$tr<br>";
}
}
}

$test = new searchAll($db,$_POST);
$test->imageSearch();

I can't see why the repeated calls to allowedImages don't return a new result every time $tr is called. If you comment out the tr line it will return 8 results however if you don't it only returns one result. I think its the fact that $db is repeatedly called in the allowedImages function but can't see a workaround.

Many thanks

A
p.s - upon further investigation the former ADODB works fine on a non persistent connection, so not quite sure what Zend is doing here??

Last edited by Ukuser26 : 04-09-2008 at 03:55 PM.
Reply With Quote