thinkphp $model _user->create ($data) data format is incorrect
Protected $_validate = Array (
Array (' name ', ' Require ', ' user name cannot be null '),
Array (' passwd ', ' require ', ' password cannot be null ')
);
function Login () {
$model _user = D ("user");
$data = Array (
' Name ' = $this->_post (' name '),
' passwd ' = $this->_post (' passwd ')
);
if (! $model _user->create ($data)) {
$this->error ($model _user->geterror (), U (' Uc/login '));
}else {
}
Title, I want to do a login automatic verification, how is not good to ask the master answer
------Solution--------------------
LZ is not changed the data table structure, clean up the cache test. If not, post the GetError information.
------Solution--------------------
...... Login why Create ($data) ... Not where ($data)->select ()?
------Solution--------------------
Quote:
... Login why Create ($data) ... Not where ($data)->select ()?
TP will be in the create of three major automatic
------Solution--------------------
Create does not seem to be $data.
------Solution--------------------
You look at the Create () method