I have the follwing code which was written to generate an array and send it back to my main page and append it to an existing table.
I am just woundering if there is any possible way to send the data generated from the below code as a single element within a JSON object.
For example:
{"arraydata":"Data Generated From The below Code","another variable":"some other data"}
An so on...
Any Suggestions??
$result = mysqli_query($con," SELECT * FROM `BIMTECH_academy_2016_classes`
WHERE `Serial`='$serial' ORDER BY `Serial` ");
while($row = mysqli_fetch_array($result))
{
echo "<tr id='" . $row['Serial'] . "'>";
echo "<td><img src='images/delete-icon.svg' id='classDeleteIcon'/></td>";
echo "<td class='datepicker' id='Date'>" . $row['Date'] . "</td>";
echo "<td class='timepicker' id='From'>" . $row['From'] . "</td>";
echo "<td class='timepicker' id='To'>" . $row['To'] . "</td>";
echo "</tr>";
}