Error "Intentando acceder al desplazamiento de matriz en el valor de tipo nulo" en el formulario de entrada [cerrado]

Estoy creando formularios para actualizar los datos de la tabla, pero los formularios me dan este error en lugar de los datos existentes de la base de datos.


Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 49

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 53

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 57

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 61

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 65

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pemesanan\edit-costumer.php on line 69

el código :

<?php
include 'koneksi.php';
include "header.php";

$id_cos=$_GET["id_costumer"];

$hasil = mysqli_query($db, "select * from costumer where id_costumer='$id_cos'");
while($data = mysqli_fetch_array($hasil))
?>
        <!-- Page Content  -->
        <div id="content">

            <nav class="navbar navbar-expand-lg navbar-light bg-light">
                <div class="container-fluid">

                    <button type="button" id="sidebarCollapse" class="btn btn-info">
                        <i class="fas fa-align-left"></i>
                        <span>Sembunyikan Sidebar</span>
                    </button>
                    <button class="btn btn-dark d-inline-block d-lg-none ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <i class="fas fa-align-justify"></i>
                    </button>

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="nav navbar-nav ml-auto">
                            <li class="nav-item active">
                                <a class="nav-link" href="edit-costumer.php">Edit</a>
                            <li class="nav-item">
                                <a class="nav-link" href="costumer.php">Input</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="tabel-costumer.php">Tabel</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            <div class="row">
            <div class="col-md-3"></div>
            <div class="col-md-6">
              <form method="post" action="edit-data-costumer.php">
                <table class="table table-hover">
                    <tr>
                        <td colspan="2"><strong>Edit Data Costumer</strong></font></td>
                    </tr>
                    <tr>
                        <td>ID Costumer</td>
                        <td><input type="text" name="id_costumer" class="form-control" maxlength="3" value="<?php echo $data ['id_costumer']; ?>"></td>
                    </tr>
                    <tr>
                        <td>Nama Costumer</td>
                        <td><input type="text" name="nm_costumer" class="form-control" maxlength="30" value="<?php echo $data ['nm_costumer']; ?>"></td>
                    </tr>
                    <tr>
                        <td>Alamat Costumer</td>
                        <td><input type="text" name="alamat_costumer" class="form-control" maxlength="50" value="<?php echo $data ['alamat_costumer']; ?>"></td>
                    </tr>
                    <tr>
                        <td>Kota</td>
                        <td><input type="text" name="kota" class="form-control" maxlength="20" value="<?php echo $data ['kota']; ?>"></td>
                    </tr>
                    <tr>
                        <td>No. Telp</td>
                        <td><input type="text" name="no_telp" class="form-control" maxlength="12" value="<?php echo $data['no_telp']; ?>"></td>
                    </tr>
                    <tr>
                        <td>Email</td>
                        <td><input type="text" name="email" class="form-control" maxlength="20" value="<?php echo $data['email']; ?>"></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input type="edit" name="edit" id="edit" value="Update" class="btn btn-primary btn-block"></td>
                    </tr>
                    <tr>
                        <td colspan="2"><input type="reset" name="reset" id="reset" value="Batal" class="btn btn-danger btn-block"></td>
                    </tr>
                </table>
            </form>
            </div>
            <div class="col-md-3"></div>
            </div>
        </div>
    </div>
<?php
include "footer.php";
?>
Answer