Strange phenomenon, unknown problem. Please look at it. Database Query class Query

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.