No data show PHP MYSQL

hi I used this code for a search system with multiple filters, the connection is successful but now data or errors are displaying. i can’t understand what’s happening. Please help me. Thanks

Serach Rubrics

Search Rubrics

                    <div class="input-group flex-nowrap">
                    <input type="text" class="form-control" name="name" placeholder="Rubric" aria-label="Username" aria-describedby="addon-wrapping">
                    <input class="form-control mt-3" name="chapter" list="datalistOptions" id="chapter" placeholder="Chapter">
                    <datalist id="datalistOptions">
                    <option value="Mind">
                    <option value="Skin">
                    <option value="Gene">
                    <option value="Extremities">
                    <option value="Rectum">
            <input class="form-control mt-3" name="category" list="datalistOptions" id="category" placeholder="Category">
                    <datalist id="datalistOptions">
                    <option value="Emotions">
                    <option value="Alternate">
                        <option value="External">
                    <option value="Emaciation">
                    <option value="Itching">
                    <option value="Anus">
                    <option value="Constipation">
                    <div class="d-grid gap-2 col-6 mx-auto mt-3">
                    <button class="btn btn-primary" name="submit" type="button">Search</button>
<div id="row">
    <table class="table table-striped table-hover">
    <td>Rubric Name</td>

            $name = real_escape_string($POST['name']);
            $chapter = real_escape_string($POST['chapter']);
            $category = real_escape_string($POST['category']);
            if($name != "" || chapter != "" || $category != ""){
               echo $query = "SELECT * FROM rubrics WHERE name = '$name' OR chapter = '$chapter' OR category = '$category'";
                $data = mysqli_query($conn, $query) or die('error');
                if(mysqli_num_rows($data) > 0){
                    while($row = mysqli_fetch_assoc($data)){
                        $name = $row['name'];
                        $chapter = $row['chapter'];
                        $category = $row['category'];
                <td><?php echo $name; ?></td>
                <td><?php echo $chapter; ?></td>
                <td><?php echo $category; ?></td>
            <td>Not found!</td>


<script type="text/javascript" src="inc/js/bootstrap.js"></script>
<script type="text/javascript" src="inc/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="inc/js/jquery-ui.js"></script>


can you show us what errors are being displayed?


The statement “exit();” should be removed from the code.

Exit(); keyword is not supposed to be there.

Hi mbarzakh, Maybe if you share a screenshot of the error it shows we can help you faster.