title: Change standard date format fetched from database Y-M-D into D-M-Y
body: <p>I am able to fetch data from a database using php. I have a field which is "DATE" but when i get the date displayed is in the format YEAR/MONTH/DAY. Is this because the standard format of the value "DATE" is that or there is any other option or way I can use in order to show the date in the format DAY/MONTH/YEAR ?? thank you</p>
  
  <p>I am usinf MYSQL and php </p>
  
  <pre><code>here is the code:
  $query = "SELECT * FROM trip";
  $result = mysql_query($query);
  echo "&lt;table &gt;"; 
  while($row = mysql_fetch_array($result)){   
  if ($row['Day'] == date("Y-m-d"))
  {
  echo '&lt;tr class="today"&gt;';
  }
  else {echo "&lt;tr&gt;";
  }
  echo "&lt;td&gt;" . $row['Day'] . "&lt;/td&gt;
  
  }
  echo "&lt;/table&gt;"; 
  mysql_close(); ?&gt;
  </code></pre>
  
  <p>----- new code ----</p>
  
  <pre><code> include('includes/connection.php');
  
      // $connection = mysql_connect('localhost', 'root', ''); 
  
  $sql = &lt;&lt;&lt;SQL
      SELECT *
      FROM `trip`
  
  SQL;
  
  if(!$result = $db-&gt;query($sql)){
      die('There was an error running the query [' . $db-&gt;error . ']');
  }
  while($row = $result-&gt;fetch_assoc()){
      echo "&lt;table &gt;"; 
                      {   
                      if ($row['Day'] == date("Y-m-d"))
                      {
                      echo '&lt;tr class="today"&gt;';
                      }
                      else {
                      echo "&lt;tr&gt;";
                      }
                      echo "&lt;td&gt;" . date('d/m/Y', strtotime($row['Day'])) . "&lt;/td&gt;
  
                      &lt;td&gt;" . $row['Country'] . "&lt;/td&gt;
                      &lt;td&gt;" . $row['Place'] . "&lt;/td&gt;
  
                      &lt;/tr&gt;";  //$row['index'] the index here is a field name
                      }
                      echo "&lt;/table&gt;"; //Close the table in HTML
  
  }
  </code></pre>