title: PHP/SQL:Data from DB don't show
body: <p>I'm making a form for a project that when the user insert their username and click submit their info will show in the respected area (with some ajax).The problem is the data show only the column name and the rest are empty. I have insert all the info needed in the table, but still data don't appear.
  Below is my PHP code:</p>
  
  <pre><code>&lt;?php
  require "co.php";
  $link = mysqli_connect($h,$u,$p,$db);
  
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error);
  }
  echo "Connected successfully";
  
  $q = "select * from login where User_name ='".$_GET['name']."'";
  $result = mysqli_query($link,$q);
  if($result){
  echo "&lt;table border='1' &gt;
  &lt;tr&gt;
  &lt;td align=center&gt; &lt;b&gt;user Id No&lt;/b&gt;&lt;/td&gt;
  &lt;td align=center&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;
  &lt;td align=center&gt;&lt;b&gt;Password&lt;/b&gt;&lt;/td&gt;
  &lt;td align=center&gt;&lt;b&gt;responsibility&lt;/b&gt;&lt;/td&gt;&lt;/td&gt;";
  
  while($data = mysql_fetch_row($result))
  {   
  echo "&lt;tr&gt;";
  echo "&lt;td align=center&gt;$data[0]&lt;/td&gt;";
  echo "&lt;td align=center&gt;$data[1]&lt;/td&gt;";
  echo "&lt;td align=center&gt;$data[2]&lt;/td&gt;";
  echo "&lt;td align=center&gt;$data[3]&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  }
  
  else{
  echo ' Failed';
  }
  ?&gt;
  </code></pre>
  
  <p>And also i include html code:</p>
  
  <pre><code>html&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {
  
  $("#display").submit(function(e) {   
       e.preventDefault();
  
   $.ajax({    //create an ajax request to load_page.php
      type: "POST",
      url: "tesz2.php",
      data: { name: $('.name').val() }, // set the naem variable             
      dataType: "html",   //expect html to be returned                
      success: function(response){                    
      $("#responsecontainer").html(response); 
      //alert(response);
               }
  
             });
        });
     });
  
   &lt;/script&gt;
  
  &lt;body&gt;
  &lt;form method =POST action=test2.php id="display"&gt;
  &lt;input type ="text" class='z' id='name'&gt;&lt;br&gt;
  &lt;input type='submit'&gt;
  &lt;/form&gt;
  
  
  &lt;h3 align="center"&gt;Manage Student Details&lt;/h3&gt;
  &lt;!--table border="1" align="center"&gt;
  &lt;tr&gt;
     &lt;td&gt; &lt;input type="button" id="display" value="Display All Data" /&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table--&gt;
  &lt;div id="responsecontainer" align="center"&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Can anybody tell me what the error or maybe some solution. Thanks</p>