December 16, 200817 yr Hi, I have a website which I need to add a list of dates and training locations too. My plan is to enter these all into a database and bring in the Latest 4 (or more, but excluding past events) dynamically at anyone time. Does anyone know the easiest way to do this? my site is in PHP... Thanks
December 16, 200817 yr Use the PHP Date() Function to format the Date to be inserted into your Database :] (take a look on php.net manuals) Hope this helps
December 16, 200817 yr Author I don't want to insert to a database though, I want to retrieve information from it to display in a div... I am new to PHP so I have no idea really... I guess this should also be moved to the PHP section? Sorry!
December 16, 200817 yr There are a couple of ways. Either do the formatting you want in SQL inside the database query using MYSQL DATE_FORMAT function, or extract the timestamp from MySQL and do the formatting in PHP using PHP's date function. There are examples on both of those pages. It really doesn't matter which you choose, though the latter might make it easier to "internationalise" the format of your dates for different locales.
December 16, 200817 yr Author Ok, thanks, but back about 20 steps... Are there any tutorials for creating simple databases and linking them so they populate a webpage...
Create an account or sign in to comment