Welcome Guest, Not a member yet? Register   Sign In
Controller and sql
#1

Hello,

Can I user   something like this
$db = \Config\Database::connect();    
 $query =  $db->query('select * from mytable');  or whatever query to process the result.
inside a Controller instead of model 
what will be the risk of using this kind sql stuff inside Controller ?
also what is the advantage of  Model ?

Thank you
Reply


Messages In This Thread
Controller and sql - by lindaw - 01-26-2023, 08:12 AM
RE: Controller and sql - by kilishan - 01-26-2023, 03:17 PM
RE: Controller and sql - by lindaw - 01-27-2023, 02:09 PM
RE: Controller and sql - by InsiteFX - 01-26-2023, 10:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB