php - Select specific data from input form in yii -
I have trouble choosing a field in an input form. I need to put a new manager permission when adding new manager and it Does not work.
if (isset ($ _ POST ['manager'])) {$ model-> Properties = $ _ Post ['Manager']; If ($ model-> Save ()) {$ sql = "Enter in the assignation (item name, user-id, dip, data) value (: item name, user id, dip, data)"; $ Parameter = array (": itemname" = & gt; 'manager', ': userid' = & gt; $ _POST ['username'], ': bizel' = & gt; null, ': data' = & Gt; null); Yii :: app () - & gt; Db- & gt; CreateCommand ($ SQL) - & gt; ($ Parameter) implementation; $ This- & gt; Redirection (array ('visual', 'id' => gt; model- & gt; username));}} The problem is on the parameter array ': UserID ' placeholder thanks.
In your controller, check the postal data by using
print_r ($ _POST); Your username must be
$ _ POST ['manager'] ['username']
Comments
Post a Comment