Php mysql查询中的where语句
我在创建查询时遇到问题。如何创建两个,其中选择一个Php mysql查询中的where语句,php,mysql,sql,select,Php,Mysql,Sql,Select,我在创建查询时遇到问题。如何创建两个,其中选择一个 select * from messages where id ='1' and where recd = '0' 谢谢仅使用WHERE子句,条件由和/或根据您的需要分开 SELECT * FROM messages WHERE id ='1' AND recd = '0' 试试这个: select * from messages where id ='1' and recd = '0' 如果id和recd字段是数值,您可以/应
select * from messages where id ='1' and where recd = '0'
谢谢仅使用WHERE子句,条件由和/或根据您的需要分开
SELECT *
FROM messages
WHERE id ='1' AND recd = '0'
试试这个:
select * from messages where id ='1' and recd = '0'
如果id和recd字段是数值,您可以/应该避免使用“single quot”以获得更好的索引搜索性能
select * from messages where id = 1 and recd = 0;
MySQL足够先进,可以在当前两种查询情况下管理此字符串/数字转换
希望这会有帮助