Database changed

mysql> select * from userinfo;
+-----------+----------+-----------------------+------------+
| firstname | lastname | username              | password   |
+-----------+----------+-----------------------+------------+
|  asif     |  kolu    |  ashufound            |  123456    |
|  faisal   |  samad   |  [email protected]  |  123456    |
|  kamran   |  shafat  |  kamthemaam           |  kamoos    |
|  ubaid    |  mir     |  [email protected]  |  qwertasd  |
|  majid    |  mir     |  zsffsa               |  afdfdsf   |
+-----------+----------+-----------------------+------------+
5 rows in set (0.00 sec)

mysql> SELECT  * from userinfo WHERE lastname = 'mir';
Empty set (0.10 sec)

mysql> SELECT  * from userinfo WHERE lastname='mir';
Empty set (0.00 sec)


这个代码简单的where子句不起作用怎么了?实际上我在插入代码中存在问题

最佳答案

您表中的姓氏在mir之前或之后可以有一个空格

   mir
  ^---^---look and remove spaces from here in your table

09-30 19:11