-1
Talk personal, I have 1 database and data with 2 tables so far the first table is responsible for registering the users with the name "users", the other table is where I want to register the events in Full_calendar with JS, my current code can pull everything that is there, but I would like to appear the indidual events of each user.
Follow my PHP search code:
<?php
include 'conexao.php';
$query_events = "SELECT id, title, color, start, end, usuario FROM events";
$resultado_events = $conn->prepare($query_events);
$resultado_events->execute();
$eventos = [];
while($row_events = $resultado_events->fetch(PDO::FETCH_ASSOC)){
$id = $row_events['id'];
$title = $row_events['title'];
$color = $row_events['color'];
$start = $row_events['start'];
$end = $row_events['end'];
$eventos[] = [
'id' => $id,
'title' => $title,
'color' => $color,
'start' => $start,
'end' => $end,
];
}
echo json_encode($eventos);
?>
and the information in the tables:
Events = id, title, color, start, end, user
user = id, name, user, email, password
I would like to show in the calendar only what is of each user when he logs in, the login system is already working
thanks for the help, but not searching, I am not able to create $_SESSION['user'] when logging in, I have this code:
– Samuel Nicolau
I think I’ll filter by ID, but I wanted by user
– Samuel Nicolau
If you put the code that records the authenticated user in the session helps me to help you, at first I am making assumptions, when said user I referred to any value q vc is using as a primary and foreign key. If you are using the user name, just make the adjustments in the sample code
– Ademir Mazer Jr - Nuno