我试图在论坛系统上搜索主题,然后出现此错误“注意:未定义变量:在第6行的C:\ xampp \ htdocs \ suaforum \ components \ search.php中进行查询”
<?php
require '../_database/database.php';
session_start();
if($_POST){
$q=$_POST['searchword'];
$sql_res=mysqli_query($database,"select * from forum_topic where forum_topic_name like '%$query%' order by forum_topic_time LIMIT 5");
//$result= mysql_query($sql_res) or die(mysql_errno());
$trws= mysqli_num_rows($sql_res);
if($trws>0){
while($row=mysqli_fetch_array($sql_res)){
$fname=$row['forum_topic_name'];
$forum_topic_id=$row['forum_topic_id'];
$re_fname='<b>'.$q.'</b>';
$final_fname = str_ireplace($q, $re_fname, $fname);
?>
当我在搜索栏上说一个字时出现此错误
''注意:未定义变量:在第6行“ C:\ xampp \ htdocs \ suaforum \ components \ search.php中查询”