I want to choose only 1 table from a database, depending on the user who is logged into the website. I want this because I'm making an account management page for site users. On this page I have a calendar (fullcalendar) where I will fetch events from a table.
What I want to do is a table for each user, and arrange a query to make me the select
of the right table to show the events of that user only.
My current code is selecting all events from a table only:
<?php
$json = array();
$requete = "SELECT * FROM eventos ORDER BY id";
try {
$bdd = new PDO('mysql:host=localhost;dbname=fullcalendar', 'root', '');
} catch(Exception $e) {
exit('Impossivel conectar à base de dados.');
}
$resultado = $bdd->query($requete) or die(print_r($bdd->errorInfo()));
echo json_encode($resultado->fetchAll(PDO::FETCH_ASSOC));
?>