Welcome Guest, Not a member yet? Register   Sign In
Model with many allowedFields data
#1
Exclamation 

Hello,
I have an Model where i need to set the "allowedFields" with big array data (more than 50 fields)!
Is possible to define "allowedFields" where i not need to insert all fields!?
thanks
Reply
#2

you mean, instead of marking allowedFields which are various you want NOTallowedFields which are fewer
yet i failed to find this type of thing. may be seniors will advise for proper solution, if it is a valid question.
happy learning CI4.
Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.  
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed. 
Reply
#3

Please read:
CodeIgniter User Guide - Using CodeIgniter’s Model - $allowedFields
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(08-02-2022, 10:46 PM)Ahmed Haroon Wrote: you mean, instead of marking allowedFields which are various you want NOTallowedFields which are fewer
yet i failed to find this type of thing. may be seniors will advise for proper solution, if it is a valid question.
happy learning CI4.

the solution is: $ClientiModel->protect(false)->insert(array("column"=>"val"));
Reply




Theme © iAndrew 2016 - Forum software by © MyBB