I am developing a search field to retrieve data in the database by filtering by some values from a drop down. I keep getting the following error:
Parse error: syntax error, unexpected '<'
The function I use to retrieve data as follows:
<?php
function show() {
$connect=mysqli_connect("localhost","root","","tsms");
$output ='';
$route = $_POST['from'];
$query = "SELECT * FROM bus WHERE route='$route'";
$result = mysqli_query($connect,$query);
$count = mysqli_num_rows($query);
for($i=0;$i<$count;$i++) {
while($row = mysqli_fetch_assoc($result)){
$imageData = '<img height="80" width="70" src="data:image/jpeg;base64,'.base64_encode( $row['image'] ).'"/>';
$arrival = $row['arrival_time'];
$departure = $row['departure_time'];
$type = $row['bus_type'];
$class = $row['class'];
$name = $row['bus_name'];
$facilities = $row['facilities'];
$reservation = $row['reservation_fee'];
$output = '<div style="background-color:lightgrey;width:1300px;border:2px solid blue;padding:5px;margin:5px;height:150px;">'.$imageData.' '.$arrival.' '.$departure.' '.$type.' '.$class.' '.$name.' '.$facilities.' '.$reservation.
<button class="button">View Seats »</button>'</div>';
}
echo $output;
}
mysqli_close($connect);
}
?>