The control area is written like this.
function Checklogin () {$condition [' employeeno '] = $_request[' Employeeno ']; $condition [' password '] = $_request[' Password ']; $model = M ("EmployeeInfo"); $results = $model->where ($condition)->select (); SQL ($model), if ($results) {if (Trim ($results [0][' Password]) = = $condition [' Password ']) {echo ' {success:true,msg: ' OK ' }"; Session::set (' Employeeno ', ' Employeeno '); Session::set (' UserInfo ', $results [0]); return;}} echo "{success:true,msg: ' There is no mutual or password error in login account! '}";
I logged in 38 times, did not succeed (prompt login account does not have mutual or password error), log also did not prompt the error.
To help me check the data, I'm going to put SQL statements, printers out, such as: Select Employeeno,password from
I use VAMP ($model)
Also not show up.
Reply to discussion (solution)
Turn on debug, check SQL statements, copy SQL statements in the database to see if there are any results
$model = M ("EmployeeInfo");
$results = $model->where ($condition)->select ();
echo $results->getlastsql ();
Plus
$condition [' _logic '] = ' and ';
$model = M ("EmployeeInfo");
$results = $model->where ($condition)->select ();
$model->getlastsql ();
Look at that.
Plus
$condition [' _logic '] = ' and ';
$model = M ("EmployeeInfo");
$results = $model->where ($condition)->select ();
$model->getlastsql ();
Look at that.
This brother is the right one!
It would be nice to add a false to your Select method. He will not execute the SQL statement. Instead, print out the SQL statement.
$model = M ("EmployeeInfo")->select (false);