• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
formatting query results

#3
[eluser]John_Betong[/eluser]
 
Try:
Code:
<?php foreach($items-result() as $item):?>
    </php if ('itemthree' == $item) { ?&gt;  
      <li class='classname'>&lt;?=$item->titleon?&gt;</li>
    &lt;?php }else{ ?&gt;    
      <li>&lt;?=$item->titleon?&gt;</li>
    &lt;?php } ?&gt;
  &lt;?php endforeach;?&gt;
  
OR this may work...

  &lt;?php foreach($items-result() as $item): ?&gt;

    &lt;?php $class = ('itemthree' == $item) : "class='classname'" : '' ?&gt;  

    &lt;?= "<li $class" .'<'  .$item->titleon .'</li>' ?&gt;

  &lt;?php endforeach; ?&gt;
&nbsp;
&nbsp;


Messages In This Thread
formatting query results - by El Forum - 10-13-2008, 03:15 AM
formatting query results - by El Forum - 10-13-2008, 04:05 AM
formatting query results - by El Forum - 10-13-2008, 04:09 AM
formatting query results - by El Forum - 10-13-2008, 04:16 AM
formatting query results - by El Forum - 10-13-2008, 06:44 AM
formatting query results - by El Forum - 10-13-2008, 06:55 AM
formatting query results - by El Forum - 10-13-2008, 07:24 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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