PHP Formating in Dreamweaver

I have to questions. I have a web based MySQL table that is used to display news on a php webpage.

I have 2 problems. One is how do i re-format the time stamp from 20061001 (YYYYMMDD) to Oct 1, 2006. I have tried to reformat the timestamp in the sql query that retrives the information and also using dreamweavers date formating, the end result remains the same, when the timestamp says 20061001 the page displays Jan 1, 1970.

My second problem is formating text from a longtext field. When i set the text formating to paragraph, the line breaks are not show. When i set the formating to preformatted the line breaks appear, but the text doesn't continue to the next line when it reaches the width limit of the page, it actually ignores the limit and the page extends until the line ends. Should i be formating this at the query level? If so how?

for the second option the reason that new lines do not appear is that html does not recognise them - you would need to repalce the new line characters with <br /> - which I would reccomend that you do with php - on saving the data into your database, rather than on retreival

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP. PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…