为啥mysql_fetch_array没有执行

WBOY
Release: 2016-06-13 11:42:52
Original
923 people have browsed it

为何mysql_fetch_array没有执行?

引用
error_reporting(0);
$conn=mysql_connect("localhost","root","root");//填写数据库连接信息
mysql_select_db("a1209173000");//填写数据库名
$valA = $_POST["valA"];
if($valA!=""){
$sql = "select * from  table where chepai='".$valA."'";
$result=mysql_query($sql);
    while($arr=mysql_fetch_array($result))
      {
        echo $arr["name"]."
";
      }
}else{
?>

输入A值:


}
?>


通过在每行后面加echo输出,发现执行到 while($arr=mysql_fetch_array($result))这时里面的没有执行,哪出问题了呢, $sql正常
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!