Jump to content

PHP SELECT


dhope

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.