我的变量正在被回显,而不是调用分配的值

问题描述

我是PHP的新手,我一直在尝试制作搜索个人资料页面。 当用户搜索个人资料并单击该个人资料时,将显示个人资料页面,其中显示一个人的姓名,专业知识和描述。

但是我的代码似乎正在回显整个代码,正如我将在下面显示的那样。 请帮忙。

<!Doctype html>

<?PHP

   include 'search.PHP';
  
?>


         <center>
         <h1>Expert Profile </h1>
         </center>
         
    <div class = "article-container">
    <? PHP 
    {
        $expertname = MysqLi_real_escape_string($conn,$_GET['expertname'] );
        $expertfield = MysqLi_real_escape_string($conn,$_GET['expertfield'] );
        $expertdesc = MysqLi_real_escape_string($conn,$_GET['expertdesc'] );
    
        
        $result = MysqLi_query($conn,$sql);
        $queryResults = MysqLi_num_rows($result);
        
         if($queryResults = 0 ) 
         {
               while($row = MysqLi_fetch_assoc($result))
               {
             
                  
                  echo  "<div class = 'article-container'> 
                 
                   <h3>Name         : ".$row['$expertname']."</h3> 
                   <p> Expert field : ".$row['$expertfield']."</p> 
                   <p> Description  : ".$row['$expertdesc']."</p>
                   
                   
                   </div>" ;
                      
             
               } 
         }
         else
         {
             echo "not working";
          
         }
        ?>
    
    
         
</div   

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)