Last active
December 11, 2015 11:39
-
-
Save travi5567/4595353 to your computer and use it in GitHub Desktop.
PHP: order,select,get return DATABASE_MODEL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Workouts_model extends CI_Model { | |
function getData() { | |
$this->db->order_by('id', 'DESC'); | |
$this->db->select('id, arms, chest, legs, abbs, back'); | |
$q = $this->db->get('workouts'); | |
if($q->num_rows() > 0) { | |
foreach ($q->result() as $row) { | |
$data[] = $row; | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment