I have this PHP function i am using to retrieve rows from a mysql database:
$stmt = $pdo_conn->prepare("SELECT * from admin where sequence > :sequence ");
$stmt->execute(array(':sequence' => $user_sequence));
$records = $stmt->fetchAll(PDO::FETCH_ASSOC);
$results=array();
foreach($records as $results) {
return $results;
}
here i am calling the function:
$test = AdminUserSessionID2('2');
echo $test["forename"];
but it is only displaying one row, what have i done wrong which is making it not display all rows?