<?php
    $username = "tostrlgj_voldy";
    $password = "Voldy25@Ilus";
    $server = "mysql:host=localhost;dbname=tostrlgj_mariage_db";

    try {
        //code...
        $conn = new PDO($server,$username,$password);
       // echo 'connexion reussie';
    } catch (PDOException $erreur) {
        //throw $th;
        echo $erreur;
    } 
  //connexion à la base de données

  function create_unique_id(){
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < 20; $i++) {
        $randomString .= $characters[mt_rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
?>