You are a great teacher Alex. I am glad I came across your channel. You have shown us how to be productive and actually get to build software with CodeIgniter. thanks for sharing wishing you every success.
Hello, thanks for the videos. They're really helpfull. I wonder if you could share your code snipets for CI development and maybe the extensions you use with VS Code on your daily work. Thank you in advance.
Very nice Alex ! Just a question regarding the JOIN query. It's very common to have multiple database fields having the same name in different tables. (eg: table1.name, table2.name, ...) When coding those JOIN query, it creates a problem when wanting to echo these fields. What is your best approach to solve it without too much extra code ? (and without renaming all database fields to make them unique and longer) Thank you !
Greetings from a venezuelan in Colombia. What a greats videos , thanks for charing your knowledge ... Would you mind to tell me which vs code theme you're using?
Hello Alex, I have a question and I can't seem to solve it. Say I have Table A, B, C and so on. Currently this is my code : return $this->db->table('users') ->groupStart() ->where('username', $str) ->orWhere('email', $str) ->groupEnd() ->join('add_game', 'add_game.user_id = users.user_id') ->get() ->getResultArray(); Right now, the result I am getting is the data from Table A is displaying multiple record based on the records I have in other tables. User A : Brand A User A : Brand B User A : Brand C How do I only show the data from Table A once. Example : User A : Brand A Brand B Brand C What am I missing here? Or do I have to do a foreach loop twice? Is there a way that I just do a foreach loop once? Hope to hear from you soon. Thanks in advance!
hello alex how can i convert this sql statement to codeigniter "Select * from table WHERE `field` LIKE '%string1%' OR `field` LIKE '%string2%'" thanks in advance.
would you like ti give us some example, how to use subquery with CI4 example code : select count(*) summaterial ,c.negara_id,sum(nominalready) as totalready from ( SELECT a.country_id,a.id_material,sum(b.ready),a.prize_unit,sum(b.ready) * a.prize_unit as nominalready, sum(b.notready) * a.prize_unit as nominalnotready FROM material as a left join stok as b on a.id_material=b.material_id group by a.id_material ) as c group by c.country_id; would you like convert it to query builder?
Hello, nice video i cant understand how pass data from controller to model query builder for example i want get one contact card view by query builder where('id', $findid) how pass $findid variable? or i should this done in controller? and second question this below as example written is query builder example or not? If yes why no connection to DB and its working? PHP Code: public function getNews($id = false) { if ($id === false) { return $this->findAll(); } return $this->asArray() ->where() ->first(); }
SELECT voted_user,count(*) FROM `voting` GROUP BY voted_user How can I convert this mysql code to query builder class in codeignitor framework.. Thanks
$db = connect_db(); $builder = $db->table('YOUR_TABLE'); $builder->selectCount('voted_user'); or $builder->countAll(); //depends on your needs $builder->groupBy("voted_user"); $query = $builder->get(); Something like that should work