0
How to Check if an id is contained in a range of ids within a field in the database
In this table below I list the "id_rota" 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 there within "$id_rota" , if it is contained do something
example if number 17 is inside $id_route echo "ok";