致命错误:未定义的类常量' Fetch_OBJ'在第23行的C:\ xampp \ htdocs \ index.php
<?php
try {
$pdo = new PDO('mysql:host=127.0.0.1;dbname=neon', 'root','');
} catch (PDOException $e) {
die('could not connect.');
}
$statement =$pdo->prepare('select * from team');
$statement->execute();
$sql = $statement->fetchAll(PDO::Fetch_OBJ);
var_dump($sql[0]->Name);
require 'index.view.php';
?>
答案 0 :(得分:1)
FETCH_OBJ将是常量名称