RT,我在mysql的客户端命令行上面执行SQL语句:
select count(*) as amount from main where id = 2;
可得到结果
+--------+
| amount |
+--------+
| 1 |
+--------+
但是在php程序里面
$sql1="select count(*) as amount from main where id = 2";
$reqult = mysql_query ( $sql1 );
echo $sql1;
$row = mysql_fetch_row ( $reqult );
$amount = $row [0];
这里的$sql1永远是空值!
而且我把$sql1换成select count(*) as amount from main; 这句又可以正常取到值,
请大侠帮小弟看哈这是个什么问题呗!
我都被这个小问题给弄晕了!
多谢!mysqlphpsqlquery
select count(*) as amount from main where id = 2;
可得到结果
+--------+
| amount |
+--------+
| 1 |
+--------+
但是在php程序里面
$sql1="select count(*) as amount from main where id = 2";
$reqult = mysql_query ( $sql1 );
echo $sql1;
$row = mysql_fetch_row ( $reqult );
$amount = $row [0];
这里的$sql1永远是空值!
而且我把$sql1换成select count(*) as amount from main; 这句又可以正常取到值,
请大侠帮小弟看哈这是个什么问题呗!
我都被这个小问题给弄晕了!
多谢!mysqlphpsqlquery
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货