How can i make the data from my query linkable/ clickable so that i can run a function when i click it. The data that need to be linkable /clickable is the date and after clicking it will run a function.
Below is my code in php
[php]<?php
if (isset($_POST[‘go’])){
if (((!empty($_POST[‘from’])&&!empty($_POST[‘to’])))&&((!empty($_POST[‘from’])&&!empty($_POST[‘to’])))){
$from = $_POST[‘from’];
$to = $_POST[‘to’];
$from =explode(’/’,$from);
$from = “$from[2]-$from[0]-$from[1]”;
$to = explode (’/’,$to);
$to = “$to[2]-$to[0]-$to[1]”;
$query= mysqli_query($con,“SELECT Date, Time, Latitude,Longitude,Depth,Magnitude FROM bulletin WHERE Date between ‘$from’ and ‘$to’;”);
$the_array = array();
while($row = mysqli_fetch_array($query)){
$date = $row[‘Date’];
$time = $row[‘Time’];
$latitude= $row[‘Latitude’];
$longitude= $row[‘Longitude’];
$depth =$row[‘Depth’];
$magnitude = $row[‘Magnitude’];
$the_arraypei[] = array($row[‘Date’] );
echo ‘
}
$js_array1 =$the_arraypei;
}
?>[/php]