Jump to content

Recommended Posts

Hi,

 

I was wondering if someone could point me in the right direction. I have built a small content management system for my website and I want to select all the pages from my database but only the last version. I would like to keep a previous version just in case I need to go back to it.

 

My select statement is:

 

SELECT page_name FROM pages WHERE user_id = $user_id AND page_visible = 1 AND page_deleted = 0 ORDER BY page_position ASC

 

But this will print all my pages including all previous versions. I have added a date_updated updated field to my database, is there away to check which is the latest version and only select this page?

 

Hope this makes sense.

 

Thank you for any help

Damian

Link to comment
https://forums.phpfreaks.com/topic/212505-php-select/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.