Miscellany
public text v1 · immutable<?php
function get10last()
$pdo = new PDO('mysql:host="<host til database>;dbname=<navnet på database>', '<brukernavn>', '<passord>');
try {
$this->getconnection();
$array = array();
$stmt = $this->pdo->prepare("select setning her");
if ($stmt->execute()) {
while($row = $stmt->fetch()) {
$array[] = $row;
}
}
$this->pdo = null;
return $array;
}
catch (Exception $e) {
$this->error[] = $e->getMessage();
}
?>