I keep receiving the error message:
for this piece of code. How do I go about resolving it?
Fatal error: Call to undefined method PDOStatement::fetch_assoc() in index.php on line 16 Call Stack: 0.0001 644064 1. {main}() index.php:0
for this piece of code. How do I go about resolving it?
<?php session_start(); require_once("../resources/php/connection.php"); // use quote or prepared statements to prevent from // SQL injection attacks! $pmname = $pdo->quote($_SESSION['pmname']); $sql = "SELECT * FROM pm_user WHERE name=$pmname"; $result = $pdo->query($sql); if($result === FALSE) { echo 'oops! the query failed! '; print_r($pdo->errorInfo()); } $row = $result->fetch_assoc(); if($row) { echo $row['img']; } else { echo 'the query return no records :(/>/>'; } ?>