微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

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

我是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 举报,一经查实,本站将立刻删除。