Welcome Guest, Not a member yet? Register   Sign In
Load more than one instance of the same library
#1

[eluser]mattalexx[/eluser]
How would I load more than one instance of the same library?

I have this:

Code:
$this->load->library('SelectQuery', array('table' => 'items'));
$this->selectquery->addGroupBys("items.id");
$this->selectquery->addJoins("

   # Must have categories with images and a parent
   JOIN categories_items
      ON items.id = categories_items.item_id
   JOIN categories
      ON (
         categories_items.category_id = categories.id
         AND categories.in_nav != 0
         )

   # Must have an artist
   JOIN artists
      ON items.artist_id = artists.id

   # Must have at least one image
   JOIN item_images
      ON item_images.item_id = items.id
   ");
$this->selectquery->addWheres("
   items.show != 0
   AND items.quantity > 0
   ");
$this->selectquery->addOrderBys("
   items.title ASC,
   items.id ASC
   ");
$this->selectquery->addFields("
   CEILING(100 - items.sale_price/items.price*100) AS percent_off
   ");

It seems like once the $this->selectquery variable is used once, it can't be used again without being overwritten.


Messages In This Thread
Load more than one instance of the same library - by El Forum - 06-01-2008, 05:00 PM
Load more than one instance of the same library - by El Forum - 06-01-2008, 06:46 PM
Load more than one instance of the same library - by El Forum - 06-01-2008, 06:48 PM
Load more than one instance of the same library - by El Forum - 06-01-2008, 06:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB