php - mysql php where子句不起作用

标签 php mysql where-clause

知道为什么这行不通吗!?

什么都不显示..

$result1 = mysql_query("select * from `suppliers` where supp_short_code='WED'") or die(mysql_error());
                while($row1 = mysql_fetch_array($result1))
                    {       
                        echo "<p>" . $row1['supp_name'] . "</p>";
                    } 

最佳答案

已解决!事实证明,当我从 Excel 导入到我的 mysql 时,在“supp_short_code”前后引入了空格,所以查询无法正常工作!

关于php - mysql php where子句不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4086378/

相关文章:

php - 如何显示数据库中的单行?

java - 如何将listview中的textview传回php

mysql - 数据库中未创建外键字段

mysql - SQL (MySQL) 第 2 部分中基于今天日期的查询返回结果

mysql - 具有多个 WHERE 子句的 SQL Like 语句

mysql - "where"或 "like"子句更适合使用索引

php - MySQL UNION - 将两个单值查询输出到不同的列中

javascript - 尝试使用转义的单引号解析JSON时Javascript中的“Unexpected identifier”错误

mysql - 如何将另一个表加入到此查询中

php - 如何在 PHP 中用盐检查 mysql 加密值?