阅读背景:

PHP PDO准备的查询不会返回for循环的结果

来源:互联网 

I have the following code:

我有以下代码:

$link = new PDO("mysql:dbname=$databasename;host=127.0.0.1",$username,$password);
$query = $link->prepare("SELECT * FROM index WHERE sbeid=:idvar");
for($j = 1; $j < count($array); $j++)
{
    if($array[$j][16] == "TRUE" || $array[$j][16] == "FALSE")
    {
        $paramforquery = $array[$j][25];
        $query->bindParam(":idvar",$paramforquery);
        $query->execute();
        $result = $query->fetchAll();
        //do things with the $result
        $query->closeCursor();
    }
    //else if, do stuff
}
$link = null;
$link = 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: