만큼 당신이이 메소드를 호출 할 필요없는이 메타 데이터를 필요로하지 않는 Note: The result set returned by mysqli_stmt_result_metadata() contains only metadata. It does not contain any row results. The rows are obtained by using the statement handle with mysqli_stmt_fetch().
http://ch.php.net/manual/en/mysqli-stmt.result-metadata.php에서.
$statement = $db->prepare("SELECT fld1, fld2 FROM phptech_contact");
$statement->execute();
$stmt->bind_result($fld1, $fld2);
while ($stmt->fetch()) {
echo "$fld1 and $fld2<br />";
}
하지만 실제로는 mysqli 확장자를 싫어합니다. PDO 내가 문제가 mysqli_stmt::result_metadata()
는 단지 메타 데이터를 보유하고 실제 결과 —의없이 mysqli_result
객체를 반환 믿습니다 ... ;-)
$db = new PDO('...');
$stmt = $db->prepare("SELECT fld1, fld2 FROM phptech_contact");
$stmt->execute();
while ($obj = $stmt->fetchObject()) {
// ...
}
또는
$objs = stmt->fetchAll(PDO::FETCH_OBJ);
의 프로세스와 크게 다르지 않습니다. 작동하지 않습니다 " – Greg