Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将while(mysql_fetch_assoc($run))转换为PDO?_Php_Mysql_Pdo - Fatal编程技术网

Php 如何将while(mysql_fetch_assoc($run))转换为PDO?

Php 如何将while(mysql_fetch_assoc($run))转换为PDO?,php,mysql,pdo,Php,Mysql,Pdo,如何将代码转换为PDO 谢谢大家! PDO备选方案是PDO::FETCH_ASSOC while($message = mysql_fetch_assoc($run)) { } while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $data = $row."\n"; print $data; }

如何将代码转换为PDO


谢谢大家!

PDO备选方案是
PDO::FETCH_ASSOC

while($message = mysql_fetch_assoc($run)) {
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  $data = $row."\n";
  print $data;
}