ACCESS SQL查询无法在PHP中运行

时间:2014-07-30 09:31:58

标签: php sql ms-access

我有sql查询它与select *一起使用但是当我输入列名时它不显示数据。

$sql2="SELECT PSO_NAME, PSO_SIGNATURE, PSO_DATE FROM SIGNATURES_DASO WHERE DASO_NO ='".$daso_no."'";
echo $sql2; //it shows the query which i tested in access runs fine.
$rs_pso_sign=odbc_exec($conn,$sql2);
if (!$rs_pso_sign) {
  exit("Error in SIGNATURE TABLE INFO SQL");
}

if(odbc_fetch_row($rs_pso_sign)){

                $psoName = odbc_result($rs_pso_sign, "PSO_NAME");
                $psoSign = odbc_result($rs_pso_sign, "PSO_SIGNATURE");
                $psoDate = odbc_result($rs_pso_sign, "PSO_DATE");
                echo $psoName;
         }
else
 {
 echo "$psoName does not exist";
}

当我做的时候它会起作用

 $sql2="SELECT * FROM SIGNATURES_DASO WHERE DASO_NO ='".$daso_no."'";

我从数据库列名检查了同样没有拼写错误。

有什么建议吗?

0 个答案:

没有答案