izbryte Posted November 18, 2007 Share Posted November 18, 2007 How do I format the date to 'm.d.y' within my results? <?php $query = "SELECT title, employer, location, date FROM jobs"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo " <tr> <td><b>{$row['title']}</b> <br>{$row['employer']}</td> <td>{$row['location']}</td> <td>{($row['date']}</td> </tr>"; } ?> Sorry if I'm a bonehead! Quote Link to comment Share on other sites More sharing options...
Barand Posted November 18, 2007 Share Posted November 18, 2007 Depends on what column type you defined for the date field Quote Link to comment Share on other sites More sharing options...
izbryte Posted November 18, 2007 Author Share Posted November 18, 2007 DATETIME Quote Link to comment Share on other sites More sharing options...
Barand Posted November 18, 2007 Share Posted November 18, 2007 echo date ('m.d.y', strtotime($row['date'])); Quote Link to comment Share on other sites More sharing options...
izbryte Posted November 18, 2007 Author Share Posted November 18, 2007 thank you so much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.