My problem is that I want to obtain specific events according to a value, and all the information of the events is retrieved from the db successfully from a file with the following code:
header('Content-Type: application/json');
$conexion = new PDO("mysql:host=localhost;dbname=scouts_601_palmira","root","");
$sql = "SELECT * FROM Eventos";
$sentencia = $conexion -> prepare($sql);
$sentencia -> execute();
$resultado = $sentencia -> fetchAll(PDO::FETCH_ASSOC);
echo json_encode($resultado);
The next file path I include in the view that the fullCalendar has ready.
events:'http://localhost/MafekingOnline/Sql/ArregloEventos.php',
What I want to achieve is that when I pass a parameter to him to compare if that event has it then he can show it, but then he omits it The code would be something like this:
header('Content-Type: application/json');
$conexion = new PDO("mysql:host=localhost;dbname=scouts_601_palmira","root","");
$sql = "SELECT * FROM Eventos WHERE Id_rama = :Id_rama";
$sentencia = $conexion -> prepare($sql);
$sentencia -> bindParam(':Id_rama', $id_rama, PDO::PARAM_STR);
$sentencia -> execute();
$resultado = $sentencia -> fetchAll(PDO::FETCH_ASSOC);
echo json_encode($resultado);
I would have to put the code of the file where I get the information from the database in the same as the fullCalendar so that I can recognize the variable (as far as it goes).
I thank you in advance for any help to find the solution.
Sources that I have consulted and that could give a clue to the solution to this problem: