在下面的代码中,我正在从 mysql 中搜索数据。在此代码中,不搜索数据,则在执行代码时显示警报框。请告诉我是否可以在警报框中放置表格以及如何放置?
<?php
$search = (isset($_POST['search']) ? $_POST['search'] : null);
mysql_connect("localhost", "root", "") OR die (mysql_error());
mysql_select_db ("slseatapp") or die(mysql_error());
$query = "SELECT * FROM `coursemaster` WHERE `course_code` LIKE '%$search%' or `course_name` like '%$search%'";
$result = mysql_query($query) or die (mysql_error());
$msg ;
if($result)
{
while($row=mysql_fetch_row($result))
{
$msg=$msg ."ID=".$row[0].",COURSE CODE=".$row[1].",COURSE NAME=".$row[2];
}
echo"<script>alert('$msg');</script>";
}
else
{
echo "No result";
}
?>
<form action="look.php" method="post">
<center> SEARCH:<input type="text" name="search" placeholder="SEARCH"><br></center>
<center> <input type="submit" name="hhhh" class="btn-success btn"></center>
</form>