about model create whiteList

Excuse me,How to use the model in create to whiteList? thanks



43.9k

I'm thinking that you are going to need to ask your question again in better English and in a more detailed form.

    $user = new Users();
    $fields = array('username', 'age', 'created_at');
    $user->save(array('username'=>'john', 'age'=>18), $fields);
    echo $user->age;

sorry, I am a Chinese

I'm thinking that you are going to need to ask your question again in better English and in a more detailed form.



1.6k

Don't worry. I can't get what you want to say, though.

If the code of @trentramseyer is what you wanted to know, would you please click Accept Answer button?

very thanks, I failed, Because the current framework required to write the mysql fields by default

``` $user = new Users(); $fields = array('username', 'age', 'created_at'); $user->save(array('username'=>'john', 'age'=>18), $fields); echo $user->age; ```

sorry, I'm Chinese,But still thank you, I failed, Because the current framework required to write the mysql fields by default

Don't worry. I can't get what you want to say, though.

If the code of @trentramseyer is what you wanted to know, would you please click Accept Answer button?



1.6k

Because the current framework required to write the mysql fields by default

I can't get what you say.

What happened? Did you get error messages?

And what you exactly want to do? What do you mean by "whitelist"?