fliptoppbox Posted May 28, 2008 Share Posted May 28, 2008 this is actually much simpler than craigslist. basically all it needs to be is one php file for image upload, with description and another php file to list the submitted descriptions as links which could think link over to the uploaded picture. I have found suitable tutorials on this but they always add the most recently submitted posting to the bottom, not the top. there doesnt even have to be different pages, this could just become an endless list of posts, newest always on top.. there also needs to be a search bar to search through the postings. i started this thread hoping somebody could point me in the right direction or maybe has code laying around they might want to share. thanks for reading, Paul Quote Link to comment Share on other sites More sharing options...
discomatt Posted May 28, 2008 Share Posted May 28, 2008 If you're using a database to store your data, simply sort descending SELECT `row` FROM `table` ORDER BY `id` DESC Searching is easy enough... you can either use fulltext searching (assuming MySQL) http://www.google.com/search?q=mysql+fulltext Or use something like SELECT `row` FROM `table` WHERE `text` LIKE '%term%' Quote Link to comment Share on other sites More sharing options...
gizmola Posted May 28, 2008 Share Posted May 28, 2008 Typical way of doing this is to store rows in a database table. Take one of those tutorials you mentioned, and get the code working, and ordering is trivial. When adding and ORDER BY clause to a sql statement the default is Ascending order. To reverse that and have it be Descending you simply tack on the DESC keyword to the ORDER BY. SELECT * FROM yourtable ORDER BY postdate DESC Voila, newest posts first. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.