paddyfields
11-20-2012, 12:42 PM
Hello.
I have a listings website where users can search with various criteria, such as below;
area: 'London'
date: '2nd November'
price: 'less than £5'
this is then put into the URL query string... mywebsite.com/search.php?area=london&date=02112012 etc...
I want the users to be able to save their search for future use, accessable from a hyperlink in their home area.
I see two solutions...
1. creating a table in my database with the rows, 'memberid', 'area' , 'date', 'price' and store them this way. With any search fields being left blank inserting a NULL value. I would then build the URL with php echo's from the database like mywebsite.com/search.php?area=<?php echo $row['area']?> etc...
2. Saving the entire URL into the database with use of $_SERVER features, linked to the members ID.
I'm pretty sure the 1st option is the way to go, but is there any other method that would be better for this before I begin working on it?
Any advice would be appreciated.
Cheers
Pat.
I have a listings website where users can search with various criteria, such as below;
area: 'London'
date: '2nd November'
price: 'less than £5'
this is then put into the URL query string... mywebsite.com/search.php?area=london&date=02112012 etc...
I want the users to be able to save their search for future use, accessable from a hyperlink in their home area.
I see two solutions...
1. creating a table in my database with the rows, 'memberid', 'area' , 'date', 'price' and store them this way. With any search fields being left blank inserting a NULL value. I would then build the URL with php echo's from the database like mywebsite.com/search.php?area=<?php echo $row['area']?> etc...
2. Saving the entire URL into the database with use of $_SERVER features, linked to the members ID.
I'm pretty sure the 1st option is the way to go, but is there any other method that would be better for this before I begin working on it?
Any advice would be appreciated.
Cheers
Pat.