I have a .php file wherein, a popup opens which has to display some data from the db when a button is clicked. There are 30 different buttons and all display different data. But the code I have written does not seem to be working. This is my code:
<?php
echo "<script>function getDataFunction(clicked_id){
$id=clicked_id;
}</script>";
session_start();
$phone=$_SESSION['phone'];
$query= "(SELECT * FROM timetable WHERE ID == '$id')";
$result = mysqli_query($conn, "SELECT * FROM timetable WHERE ID == '$id'");
$row = $result->fetch_assoc();
$timefrom=$row['timefrom'];
$timeto=$row['timeto'];
$status=$row['stat'];
$comment=$row['comm'];
?>