当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - Database returning zero rows

问题描述:

I have been having some trouble running SQLi queries in PHP, so I went to the database directly through PHP Admin and even when I run the most basic of queries such as the example below I am getting an empty results set.

Is there any reason why this could happen?

SELECT 'fname' FROM 'participants' WHERE 'sname' = 'Jones';

网友答案:

If you had error reporting enabled, you'd see that your query throws an error because you are using ' instead of backticks ` for your table and column names.

Try it like this:

SELECT `fname` FROM `participants` WHERE `sname` = 'Jones'; 
分享给朋友:
您可能感兴趣的文章:
随机阅读: