Jump to content

php craigslist - need some direction!


fliptoppbox

Recommended Posts

 

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

Link to comment
Share on other sites

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%'

Link to comment
Share on other sites

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.

Link to comment
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.