CodeIgniter 4 from Scratch - #10 - Query Builder

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 51

  • @parvezahmed3559
    @parvezahmed3559 ปีที่แล้ว

    Millions of Thanks for in detail description of everything

  • @bothwellw
    @bothwellw 3 ปีที่แล้ว +7

    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.

  • @wandersonsousa1891
    @wandersonsousa1891 3 ปีที่แล้ว

    Thank you, im learning so much with your videos from Brazil !

  • @satishksharma
    @satishksharma 4 ปีที่แล้ว

    I like your tutorials very much. Please make video on prevent sql injection in codeigniter4. How to use prepare statement and excute in ci4.

  • @marcoblom7133
    @marcoblom7133 9 หลายเดือนก่อน

    Great course, but how do we get the results passed to a view? small sample would help, appreciated!

  • @shafiu283
    @shafiu283 4 ปีที่แล้ว +1

    Thanks, Alex. Please we need a tutorial on Codeigniter 4 multi-language

  • @abel406
    @abel406 ปีที่แล้ว

    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.

  • @NetTechies11
    @NetTechies11 ปีที่แล้ว

    Hi Alex, why do I have to add routes manually in my routing file?
    FYI- I did not use composer to install CI4

  • @zettalhiba3400
    @zettalhiba3400 3 ปีที่แล้ว

    Thanks Alex, how to use pagination with Query Builder

  • @we_tech_bros
    @we_tech_bros 3 ปีที่แล้ว +1

    why is everyone using print_r... will my users see raw datas? why not use view and make this proper

  • @Xvqier
    @Xvqier 4 ปีที่แล้ว

    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!

  • @IngPedroAraujo
    @IngPedroAraujo 3 ปีที่แล้ว

    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?

  • @tamilwargod4813
    @tamilwargod4813 4 ปีที่แล้ว

    thanks man you are really good teacher

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      I appreciate that!

  • @laurentiuudrea1743
    @laurentiuudrea1743 4 ปีที่แล้ว

    At 21:11 you write wrong ascending. Is ASC not ACS. Thank you very much for your tuts. Are so usefull and very importants for me!

  • @humbucker1981
    @humbucker1981 2 ปีที่แล้ว

    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 !

  • @SHADAN.__.KHAN077
    @SHADAN.__.KHAN077 3 ปีที่แล้ว

    Thank you sir

  • @Mnilionic
    @Mnilionic ปีที่แล้ว

    Can we setup aliases for tables and fields?

  • @SHADAN.__.KHAN077
    @SHADAN.__.KHAN077 3 ปีที่แล้ว

    Please explain Routes

  • @unboxkarunadu372
    @unboxkarunadu372 4 ปีที่แล้ว

    You know my request alex, a mini project with CI-4 restful api and Vuejs... Please make it as ur first preference, thanks Alex in advance ✌️😍

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว +1

      Stay tuned today!!!!

  • @brkseries
    @brkseries 4 ปีที่แล้ว +1

    Like you video bro.
    Keep it up.
    Please make some project with codeignator 4 it will help us more .
    Thanks for everything 🧡💜🖤

    • @radiojibon-7102
      @radiojibon-7102 4 ปีที่แล้ว +1

      :-):-)

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว +1

      Yes I will. Thanks for the support. Don't forget to subscribe :)

    • @brkseries
      @brkseries 4 ปีที่แล้ว

      @@AlexLancer Subscribe already done bro. Keep it up we are always with you 🧡💜🖤

  • @christianvalenciadelacuba9952
    @christianvalenciadelacuba9952 4 ปีที่แล้ว

    HI Alex, Excelent job, thanks for bring to us this tutorials!!
    i have a question : The models can be use for any Database (mysql, postgre, MSSQL?)

  • @patrickwallin3512
    @patrickwallin3512 4 ปีที่แล้ว

    The codeigniter extensions on VS code isn't working. It does not show intellisense at all. I did restart VS code and it did not help. Please advice.

  • @sangwonseo
    @sangwonseo 4 ปีที่แล้ว

    Thank you for the really nice tutorial!

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      You're very welcome!

  • @aceblues9763
    @aceblues9763 4 ปีที่แล้ว

    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.

  • @iboyaimamangang6106
    @iboyaimamangang6106 4 ปีที่แล้ว

    Please a ci4 full project on online examination and result generation

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      Hey, Iboyaima, not something that is on my ToDo list at the moment. Maybe at some time in fututre. Thanks for the suggestion, though.

  • @manideep_talampally
    @manideep_talampally 4 ปีที่แล้ว

    Sir make a video on LOGIN WITH GOOGLE / FACEBOOK

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      Manideep, thanks for the idea. I am considering doing that.

    • @manideep_talampally
      @manideep_talampally 4 ปีที่แล้ว

      @@AlexLancer 🤩thanks a alot.🤩I'm waiting

    • @manideep_talampally
      @manideep_talampally 4 ปีที่แล้ว

      @@AlexLancer if you have time , also make a video on email class in codeigniter4 to send mails please.

  • @dedyhariadi6726
    @dedyhariadi6726 4 ปีที่แล้ว

    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?

  • @ZDarjus
    @ZDarjus 3 ปีที่แล้ว

    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(); }

  • @s000071
    @s000071 4 ปีที่แล้ว

    Hello Alex,
    I want to join 3 tables together. How I can do this?

    • @LlegoManuel
      @LlegoManuel 4 ปีที่แล้ว

      You have to use three or more join statements (I mean $this->db->join()) for each one of the tables

  • @flinsetyadi2166
    @flinsetyadi2166 4 ปีที่แล้ว

    hello alex how can i convert
    $cici = $this->db->query("SELECT max(ID_Pendaftaran) as kodeTerbesar FROM pendaftaran_skhpn");
    $kd = "";
    if($cici->num_rows()>0){
    foreach($cici>result() as $k){
    $tmp = ((int)$k->Kode_max)+1;
    $kd = sprintf("%04s", $tmp);
    }
    }else{
    $kd= "0001";
    }
    date_default_timezone_set('Asia/Jakarta');
    return (date('dmy').$kd);

  • @reeshuraj3820
    @reeshuraj3820 4 ปีที่แล้ว

    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

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว +4

      $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

  • @zaakhirpouzi283
    @zaakhirpouzi283 4 ปีที่แล้ว

  • @UvemweugmuhwemOsas
    @UvemweugmuhwemOsas 4 ปีที่แล้ว

    Please Ci4+rest api+openapi swagger

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      Maybe in future.

  • @mhankalbhagt6030
    @mhankalbhagt6030 4 ปีที่แล้ว

    payment getway in codeigniter 4.0.3