Showing didfferent data in different tabs

I have a tab panel and 2 separate tabs in which I can upload and display pictures. Currently both of them show the same pictures eg if I upload picture in one tab then it is automatically shown in another tab also. I want to make each tab recognise and load only those pictures that are loaded to that tab only. Both tabs are sharing the same database table and I am using PHP to access the data. It’s Zend MVC pattern and I am wondering how to make tab content unique on the basis of a field in the table. I am sending url with tabid to controller and it saves it in the database but I am having problem in retrieving the content from the database and showing them in the each of the tabs. I would be grateful if anyone can provide some guidance.

url sent from javascript : attachments/gallery?tabid=1?

Inside php controller:
public function galleryAction(){
  $attHelper = $this->_helper->getHelper("attachmentsHelper");
  $type= $this->_getParam('type', "");
  $tabId= $this->_getParam('tabid', "");
  try {
   $model = $attHelper->load($type, $tabId);
   $array = array();
   if (is_array($model)){
    foreach($model as $att){
     $item = array(
      'id' => $att->getId(),
      'user_id' => $att->getUserId(),
      'description' => $att->getDescription(),
      //'tabid' =>$att->getTabId()  -this doesn't work and gives an error eventhough value is stored in database
     $array[] = $item;
  print("tabId".$tabId); // doesn't show value of tab id and doesn't display all the images uploaded in that tab

   //$json["attachments"] = $array;
   $this->view->attachments = $array;

  }catch (Exception $e){

query inside load function:
$select->where('type = ?', $type)
      ->where('tabid = ?', $tabId); // do i hav to modify it?
 $rows = $dbtable->fetchAll($select);

//'tabid' =>$att->getTabId()  -this doesn't work and gives an error even though value is stored in database

What does the error say.

I’d say it’s a safe bet the cause of your problem is the the method getTabId()

Post the code for getTabId()

Oops I just called it but didn’t write anything inside it. I am a bit vague coz I am trying to add this functionality to the code which was written by somebody else. Can you plz provide some hint what should be written inside it?

hahahahaha :smiley:

ok now I wrote inside that function too :D. It is a getter function and it fetches the value from database but still the problem of showing different data in different tab is not resolved. Wat else can be the possible solution?
public function getTabId(){
return $this->_tab_id;

Thanks "webdev1958 ". The problem was this function and also with url parameters while sending from javascript. I have resolved them. Hurray!!!