title: I can not retrieve data from the database mysql pdo php
body: <p>I have tried to check what might be the reason my code does not  display data from the database but it seems I can’t .there is data in the db but it does not get displayed </p>
  
  <pre><code>&lt;?php
      try {
      $con = new PDO('mysql:host=localhost;dbname=tish_database;charset=utf8','root','');
      echo "we connected" ;
      } catch(PDOException $e){
      echo 'Connection failed'.$e-&gt;getMessage();
      }
  
      ?&gt;
      &lt;?Php
  
      $query ="select date_created from tish_user";
          $result= $con-&gt;prepare($query);
          $result-&gt;execute();
          while($row = $result-&gt;fetch(PDO::FETCH_ASSOC)){
      echo $row['date_created'];
  
      }
      ?&gt;
  </code></pre>