如何回响警报?

我想在数据插入之前在PHP中使用Java脚本警报。我能够将数据插入数据库,但echo无法完成其工作。这可能只是一个简单的错误,但我无法发现它:(

/// Java script
/// send data for insertion
$.get("tute7_add.php",{unit_code:unit_code,unit_name:unit_name,lecturer:lecturer,semester:semester}).done(function(data){
                    alert('You have added a unit successfully!');
                });

tute7_add.php

<?php
            // I Can't send alert!!
            echo "<script type='text/javascript'>
                         alert('Don\'t have a record');
                    </script>";

            $code= $_GET['unit_code'];
            $name= $_GET['unit_name'];
            $lecturer= $_GET['lecturer'];
            $semester= $_GET['semester'];

            $query = "INSERT INTO units (`unit_code`,`unit_name`,`lecturer`,`semester`) VALUES ('$code','$name','$lecturer','$semester');";
            $mysqli->query($query);
    ?>