Db query Ci3 to Ci4 |
I not winning with simple tasks in CodeIgniter 4, instead of explaining the many errors and things ive tried, i thought i would try a different approach.
Can you please tell me how to write the following in Ci4 Code: function login($username,$password) Ive read the following and none seem to help me: https://forum.codeigniter.com/thread-76383.html https://codeigniter.com/user_guide/datab...cting-data https://codeigniter.com/user_guide/model...l-creation Its either the database connection is not available or in the following case: Code: <?php InvalidArgumentException admin is not a valid database connection group.
If it says admin is not a valid connection group, then it is what it is. Double check you db config.
Here is an example of what you can do for your login() function in your model: PHP Code: function login($username,$password)
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Thank you. ill try this
however, admin is a column in my database and not the of my db so i would have anything to do with the db config file... right ? I was just going through the recipe tutorial on your website
(10-16-2021, 09:24 AM)CodingInCodeigniter Wrote: however, admin is a column in my database and not the of my db so i would have anything to do with the db config file... right ?$DBGroup is only used if you want your model to connect to a different database than the default config. Otherwise, you have nothing special to do and it will automatically connect to the default db. See these 2 pages for more info : DB Config: https://codeigniter.com/user_guide/datab...ation.html Model: https://codeigniter.com/user_guide/model...e-database If admin is a column then you can add it to the select. Otherwise it will select *. PHP Code: $this->select('admin') (10-16-2021, 09:24 AM)CodingInCodeigniter Wrote: I was just going through the recipe tutorial on your websiteCool. Let me know if you have any question.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |