<?php

try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname;charset=utf8mb4;collation=utf8_general_ci;prefix=''", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$total_questions = count($questions);
$page_questions = $total_questions + 1;
$current_page = 1;


while($current_page < $page_questions) {
?><li><a href="#question-<?php echo $current_page; ?>">#<?php echo $current_page; ?><br><small>Q<?php echo $current_page; ?></small></a></li><?php
$current_page ++;

}

}catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}


?>
