PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i have a table in mysql setup with information about upcoming shows for a band
the date column has the date formatted as yyyy-mm-dd
when i display the date on the webpage from the mysql query i want it to be displayed as mm-dd-yyyy
here's the code i use (took out all the other column info)
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
My recommendation is to handle your date formatting on the DB. It makes the PHP script faster. The query will execute in like 0.0001 seconds with no formatting and like 0.002 with formatting. IN PHP date formatting adds a significant amount of processing time (with respect to the entire page processing time).