繁体   English   中英

phpMyadmin 在 sql 查询中返回 0 行

[英]phpMyadmin returns 0 rows in sql query

这是我的查询

SELECT * from status_votes where vote = 'like' and status_id = 1 and item_poster = 'LUcase'

它返回 0 行,但是当我查看表时,有与我的查询匹配的行phpmyadmin 显示行

请让我知道我哪里出错了...

尝试减少查询以查看哪个 WHERE 子句导致问题:

一次尝试以下一行:

SELECT * from status_votes where vote = 'like' and status_id = 1 and item_poster = 'LUcase'
SELECT * from status_votes where vote = 'like' and status_id = 1 and item_poster = 'Lucase'
SELECT * from status_votes where vote = 'like' and item_poster = 'LUcase'
SELECT * from status_votes where status_id = 1 and item_poster = 'LUcase'
SELECT * from status_votes where vote = 'like' 
SELECT * from status_votes where status_id = 1 
SELECT * from status_votes where item_poster = 'LUcase'
SELECT * from status_votes 

找出问题应该不难...

我的假设是,在查看 phpMyAdmin 中的值时,您的数据中可能有前导或尾随空格不可见。 您能否尝试在 phpMyAdmin 中编辑一条记录,看看它是否确实包含空格。

请尝试运行此查询:

SELECT *
FROM status_votes
WHERE TRIM(vote) = 'like'
AND status_id = 1
AND TRIM(item_poster) = 'LUcase';

如果这不起作用,你能分享你的表结构吗?

尝试以下查询:

SELECT * FROM `status_votes`
 WHERE `vote` = 'like'
   AND `status_id` = '1'
   AND `item_poster` = 'LUcase' 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM