How to check if an id is contained within a range of ids within a field in the database
In this table below I list the "routable id" it returns me IDs separated by comma 16,17,18,19 .....
$numero = $_GET["numero"];
$bd = new MySQLiConnection();
$sql3 = $bd->prepare( "SELECT * FROM pax where id_rfid = ? " ) or exit(
$mysqli->error );
$sql3->bind_param('s', $id_rfid); // Coloca o valor de $data no lugar da
primeira interrogação (?)
$sql3->execute();
$resultcar = $sql3->get_result();
while( $row = $resultcar->fetch_assoc() )
{
$id_rota1 = $row['id_rota'];// 16,17,18,19,20
}
I need to check if a number is within "$ id_rota", if it is contained do something
example if number 17 is inside $ rotate_id echo "ok";