Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Showing dates from a database...

Featured Replies

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

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

  • 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!

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.