Database connection
set_charset ("UTF8")) { printf ("Character Set UTF8 load error:%s\n", $mysqli->error);} else { //printf (" Set current character set:%s\n ", $mysqli->character_set_name ());} $mysqli->query ("Set names ' UTF8 '");//write Library $mysqli->query ("Set character set ' UTF8 '");//Read library//$mysqli->close ();
Include './xitong/lianjiemysql.php ';//query if ($row = $mysqli->query ("select * from Yonghu where Mingzi_shouji = ' $u ' and Mima= ' $p ')) { $r = $row->fetch_array (); Print_r ($r); } else { echo mysql_error (); }
In the case of the name and password correct. And the database connection is also normal, he is the query does not come out. General this kind of problem, find the mistake, how can find?
Reply to discussion (solution)
What's even more strange is. Search in phpMyAdmin
SELECT * from Yonghu where Mingzishouji = ' 134213213 ';
Also 0 returns. This field is 134213213
If you directly execute SELECT * FROM Yonghu
, it can be print_t.
1 but adding where Mingzishouji = ' 123 ' cannot be queried. The field is there for these 123 to exist.
All right, I'm a ghost. The original is the error in the field.