Action
Public Function login () {
$name =$_post[' name '];
$PSW = $_post[' pwd '];
$login 1= D (' Login ');
$ab = $login 1-> Loginmodel ($name);
Echo $ab;
Model
Public Function Loginmodel ($name) {
$sql = "SELECT * from userlogin where username = ' $name '";
$info =mysql_query ($sql);
$a =mysql_fetch_array ($info);
return $a;
Html
Reply to discussion (solution)
$ab is an array, echo is not. Print_r ($AB); Get what
$ab is an array, echo is not. Print_r ($AB); Get what
Or not output on the page
Does the confirmation program enter the model, public function Loginmodel ($name) {exit;//See if you can quit.
Does the confirmation program enter the model, public function Loginmodel ($name) {exit;//See if you can quit.
Into the
$sql = "SELECT * from userlogin where username = ' $name '";
Echo $sql;
SQL statements can be output on the page
SELECT * from userlogin where username = ' eeee '
$a =mysql_fetch_array ($info);
Var_dump ($a); Post the results
$a =mysql_fetch_array ($info);
Var_dump ($a); Post the results
BOOL (FALSE)
That means you don't have that record in your table.
I put SQL in the database and I can find out the value.
Does the PHP error prompt open? Try the following sentence before executing the query
mysql_query ("Set names UTF8"); If your watch is GBK, change it to GBK.
Does the PHP error prompt open? Try the following sentence before executing the query
mysql_query ("Set names UTF8"); If your watch is GBK, change it to GBK.
No, no, it's not my place, it's wrong.
$sql = "SELECT * from userlogin where username = ' $name '";
mysql_query ("Set names UTF8");
$info =mysql_query ($sql) or Die (Mysql_error ());
$a =mysql_fetch_array ($info);
Var_dump ($a);
What is the result now, to report what is wrong.
$sql = "SELECT * from userlogin where username = ' $name '";
mysql_query ("Set names UTF8");
$info =mysql_query ($sql) or Die (Mysql_error ());
$a =mysql_fetch_array ($info);
Var_dump ($a);
What is the result now, to report what is wrong.
Add this or Die (Mysql_error ()); the SELECT * from userlogin where username = "Access denied for user ' ODBC ' @ ' localhost ' (using P Assword:no)
Feel no link database
Do you have ODBC this user, to verify that both users and passwords are entered correctly.
My MySQL has no password with the TP frame
Feel no link database
I don't know where the problem is.
Do you have ODBC this user, if any, authorized?
Just learned, and I'm not very good at it.
I don't know exactly what the problem is, but it's solved. I wrote it in another way, called the next in the original delete and replaced this is good ....