mysql query within a block

edited November 2012 in Modules
hello ,
What can I do to solve this problem.

{$domains= fuel_model('domains',array('find'='all','limit'=$topdomains_limit,'where'=star=3))} ===>working
star>3
------
{$domains= fuel_model('domains',array('find'='all','limit'=$topdomains_limit,'where'=star>3))} ===>not working
thank you

Comments

  • edited 5:03AM
    Does something like this work?
    {$domains= fuel_model('news',array(find='all' limit=1 where='star > 3'))}

    Are you using 0.93 or 1.0? If 0.93, there have been a couple changes to the php_to_template_syntax function in the MY_string_helper for 1.0 to help with the conversion of php syntax to the templating syntax. You can put in the following and save it and it should be converted:
    {$domains= fuel_model('domains',array('find'=>'all','limit'=>$topdomains_limit,'where'=> 'star>3'))}

    If you are still having trouble, does the query need to be in the block or can the result of the query be passed to the block in your layout with the 'var' parameter?
  • edited 5:03AM
    using 0.93;
    {$domains= fuel_model('news',array(find='all' limit=1 where='star > 3'))}
    worked fine.
    ---------------------
    but its logic looks like strange, is there any source to learn this kind of templating ?
    thank you
Sign In or Register to comment.