Welcome Guest, Not a member yet? Register   Sign In
Stuck in fetching specific data
#1

Hello to everyone! I'm creating my own app, where people can share own usernames. I have a problem here. Everthing is fine, but i'm unable to fetch data correctely.

What i want to do is:
  • grub from my database_name where people have a specific platform_name
So basically if people match Telegram, this query will output only those people. 

I'm using this to get usernames but now i need to filter them:

PHP Code:
        public function get_usernames($slug FALSE$limit FALSE$offset FALSE){
            if (
$limit) {
                
$this->db->limit($limit ,$offset);
            }
            if(
$slug === FALSE){
                
$this->db->order_by('usernames.id''DESC');
                
$query $this->db->get('usernames');
                return 
$query->result_array();
            }

            
$query $this->db->get_where('usernames', array('slug' => $slug));
            return 
$query->row_array();
        } 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB