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 lastest 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
Page 1 of 1
Showing dates from a database...
#2
Posted 16 December 2008 - 11:12 AM
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
Hope this helps
#3
Posted 16 December 2008 - 01:27 PM
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!
I am new to PHP so I have no idea really...
I guess this should also be moved to the PHP section? Sorry!
#4
Posted 16 December 2008 - 02:53 PM
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.
#5
Posted 16 December 2008 - 04:15 PM
Ok, thanks, but back about 20 steps...
Are there any tutorials for creating simple databases and linking them so they populate a webpage...
Are there any tutorials for creating simple databases and linking them so they populate a webpage...
- ← Please help me with PHP session
- Server Side (PHP, Databases, ASP.NET, etc)
- One for your PHP heads out there →
Share this topic:
Page 1 of 1
Help
















