strtr VS CI bug? result parse error

#1
[eluser]metaltapimenye[/eluser]
hi guys.. i think i found kind of bug while migrating old system on my office.
conditions:
fetching array trough native while() => mysql_fetch_assoc().

controler:
Code:
<?php
class Welcome extends Controller {

    function Welcome(){
          parent::Controller();
        }
        function index(){
        $this->load->view('old/something');
    }
        function bug(){
          $this->load->view('old/bug');
        }
}

view/old/bug.php
Code:
<?php
$s=mysql_query('select * from promotion where 1 /*promoend >= CURDATE()*/ order by promoid desc');
$c=mysql_num_rows($s);
$d=date('Ymd');
    
while($r=mysql_fetch_assoc($s)){
  ##bug(?) notice: start
  echo $c=(strtr($r['promoend'],array(" "=>"","-"=>"",":"=>""))>$d)?'#caffca':'#e9e9e9';
  ##notice:end
}?>

related route:
Code:
$route['^(?!test).*'] = "welcome/$0";

url hit: http://localhost/CI_Dir/bug

result:
Parse error: parse error in C:\wamp\www\CI_Dir\system\application\views\old\bug.php on line (line_num)

note:i use index.php cleanup .htaccess

its running well when i replace and reassign the variable [notice] part to..
Code:
$new_var=strtr($r['promoend'],array(" "=>"","-"=>"",":"=>""));
echo $c=($new_var > $d)?'#caffca':'#e9e9e9';


thx


Messages In This Thread
strtr VS CI bug? result parse error - by El Forum - 06-29-2010, 10:58 PM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 12:05 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 12:47 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 01:10 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 01:30 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 01:47 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 01:58 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 02:07 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 02:11 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 02:17 AM
strtr VS CI bug? result parse error - by El Forum - 06-30-2010, 08:15 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.