Results 1 to 2 of 2

Thread: Combining Rowsets

  1. #1
    aadel is offline Junior Member
    Join Date
    Apr 2012
    Posts
    8

    Default Combining Rowsets

    Hey everyone!

    I have two rowsets. I would like the rows from the second rowset to be added to the end of the first rowset.
    I tried an array_push:

    foreach($result2 as $row)
    {
    array_push($result1, $row);
    }

    Of course, $result and $result2 are OBJECTS, NOT ARRAYS, so that doesn't work!

    How would I be able to add these rows to my results?

  2. #2
    rbroen is offline Junior Member
    Join Date
    Jun 2010
    Location
    Roermond, The Netherlands
    Posts
    29

    Default

    Quote Originally Posted by aadel View Post
    Hey everyone!

    I have two rowsets. I would like the rows from the second rowset to be added to the end of the first rowset.
    I tried an array_push:

    foreach($result2 as $row)
    {
    array_push($result1, $row);
    }

    Of course, $result and $result2 are OBJECTS, NOT ARRAYS, so that doesn't work!

    How would I be able to add these rows to my results?
    A Zend_Db_Table_Rowset class has a relationship with the database; you will assume the data you use in Zend_Db_Table_Rowset is authentic and retrieved from the database in a normal way.

    Why would you risk errors by removing the luxury of having the assumption that the RowSet came from one query?

    I would create a new array (or an object that can be iterated) to hold the results and add all rows to that by using two foreach loops.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •