title: Compare 2 values in same row and same table using Codeigniter
body: <p>Can anybody help me out, while my solution does not seem to work:</p>
  
  <pre><code>$this-&gt;db-&gt;where('stock &lt;=','stock_min');
  $res = $this-&gt;db-&gt;get("products")-&gt;result();
  </code></pre>
  
  <p>You see I want to compare the field 'stock' to be less than or equal to 'stock_min'...</p>
  
  <p>Someone?</p>
  
  <p>As requested the table-structure:</p>
  
  <pre><code>    CREATE TABLE IF NOT EXISTS `products` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `sub_of` int(11) DEFAULT NULL,
    `category` int(45) NOT NULL DEFAULT '0',
    `name` varchar(45) NOT NULL DEFAULT '',
    `slug` varchar(250) NOT NULL,
    `number` varchar(45) DEFAULT NULL,
    `description` text NOT NULL,
    `value` decimal(5,0) NOT NULL DEFAULT '0',
    `value_discount` varchar(100) DEFAULT NULL,
    `yell` varchar(100) DEFAULT NULL,
    `display_price` tinyint(1) DEFAULT '0',
    `stock` int(11) NOT NULL DEFAULT '0',
    `stock_min` int(11) NOT NULL DEFAULT '1',
    `warned` tinyint(2) NOT NULL DEFAULT '0',
    `relation` varchar(350) DEFAULT NULL,
    `supplier` varchar(150) DEFAULT NULL,
    `price_in` decimal(10,2) DEFAULT '0.00',
    `price_out` decimal(10,2) DEFAULT '0.00',
    `price_out_btw` decimal(10,2) DEFAULT '0.00',
    `active` smallint(6) DEFAULT '0',
    `display_from` date NOT NULL DEFAULT '0000-00-00',
    `display_till` date NOT NULL DEFAULT '0000-00-00',
    `seen` int(11) NOT NULL DEFAULT '0',
    `info_requested` int(11) NOT NULL DEFAULT '0',
    `inserted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=322 ;
  </code></pre>