thats my SQL Query
$stmt = $con->prepare("select * from fistevent WHERE row_name LIKE 'A%' And Event_Id =? OR row_name LIKE 'B%' And Event_Id =? OR row_name LIKE 'C%' And Event_Id =? OR row_name LIKE 'D%' And Event_Id =? OR row_name LIKE 'E%' And Event_Id =? order by row_name ASC");
$stmt->bind_param("s", $_POST['EventId']);
$stmt->execute();
$result = $stmt->get_result();
How to compare values from database with array comes from html in my code
$TicketType =$_POST['Tickettype'];
$seatS=$_POST['finalSeats'];
$EventId=$_POST["Eventid"];
$sqlData = array();
getting results from database
$stmt = $con->prepare("SELECT * FROM fist WHERE `Id`=? AND `Type`=?") or die($con->error);
binding the results
$stmt->bind_param("ss",$EventId , $TicketType);
$stmt->execute();
$stmt->store_result();
$stmt-> bind_result($id,$Event_Id,$TicketType,$seats);
if($stmt->fetch())
{
$data[] = array($id,$Event_Id,$TicketType,$seats);
$Tickettype=$TicketType;
$Rowname=$row_name;
$Seats=$seats;
$cats = array_filter(array_map('trim', explode(',', $seatS)));
foreach($cats as $key => $cat ) {
Here i want to compare $cat with database values $Seats But
while($Seats==$cat)
{
echo "already hold";
}
else
{
echo "hold the seats";
}
}
}