• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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