['default' => 1]]);
} else{
$page_id = 1;
}
// Attempt select query execution
try{
$sql = 'SELECT id, date, stub_pl, text_pl FROM news WHERE id = :id';
if($stmt = $pdo->prepare($sql)){
$stmt->bindParam(":id", $param_id, PDO::PARAM_STR);
$param_id = $page_id;
if($stmt->execute()){
if($stmt->rowCount() == 1){
if($row = $stmt->fetch()){
$article_data = array(
'date' => date('d.m.Y', strtotime($row['date'])),
'stub' => $row['stub_pl'],
'id' => $row['id'],
'text' => $row['text_pl']
);
}
} else {
unset($stmt);
unset($pdo);
http_response_code(404);
include('/pl/404.html');
die();
}
}
// Close statement
unset($stmt);
}
} catch(PDOException $e){
die('ERROR: Could not able to execute $sql. ' . $e->getMessage());
}
?>
Zakład Fizyki Nanostruktur i Nanotechnologii