0

I have filenames stored in a database table along with other info. In a report I want the file extensions of the stored data. The database connection is made earlier in the code and not shown. Here's the code I use to retrieve the data:

 <php
    $query = $con->query('SELECT distinct(d.log_time), d.address, d.filename , i.country, i.area, i.city FROM download as d, lookup as i WHERE filename is not null and d.ref = i.id ORDER BY log_time, address, filename,country,area,city');


while ($row = $query->fetch()) 
{
    echo "<tr>";
    echo "<td>" . $row['log_time'] ."</td>";
    echo "<td>" . $row['address'] ."</td>";
    echo "<td>" . $row['filename'] ."</td>";
    echo "<td>" . $row['country'] . "</td>";
    echo "<td>" . $row['area'] . "</td>";
    echo "<td>" . $row['city'] . "</td>";
    echo "</tr>";
}
?>

How do I get just the file extension for each filename?

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
Larry78723
  • 31
  • 6

0 Answers0