Welcome Guest, Not a member yet? Register   Sign In
How can i make model query based on images
#2

(This post was last modified: 08-18-2015, 11:15 PM by Wouter60.)

In CI it is much easier.

PHP Code:
$query=$this->db->query("SELECT * FROM table ORDER BY id DESC LIMIT 4"); 
To display the first row (your latest article):
PHP Code:
$main_article $query->row(0); 

To display the next article at the top your right column:
PHP Code:
$topright_article $query->row(1); 
To display the next 2 items:
PHP Code:
for ($x=3$x<5$x++) {
  $right_article[] = $query->row($x);


If you want to do this in a model, make your model return the $query object.
Reply


Messages In This Thread
RE: How can i make model query based on images - by Wouter60 - 08-18-2015, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB