art15 Posted May 5, 2008 Share Posted May 5, 2008 Hi All, I have a script in place which write products per page from the value defined in the admin panel for products per page. (for eg: if it is specified inside the admin panel as 15 per page, the web will show 15 products per page). I was looking to put a drop down on web for the user to select the products per page. I tried few things and somewhere I got for one user by updating the database with the drop down value the user selects but this way if there is some other user selecting different option the database will update itself and will be a problem every time. Can any one suggest how this can be done. Thanks Link to comment https://forums.phpfreaks.com/topic/104157-products-per-page/ Share on other sites More sharing options...
DyslexicDog Posted May 5, 2008 Share Posted May 5, 2008 If you already have the database up and running you could add another column to the user information to retain the products per page info. Just add another variable to the session to follow this information during a user visit. Link to comment https://forums.phpfreaks.com/topic/104157-products-per-page/#findComment-533229 Share on other sites More sharing options...
art15 Posted May 5, 2008 Author Share Posted May 5, 2008 If you already have the database up and running you could add another column to the user information to retain the products per page info. Just add another variable to the session to follow this information during a user visit. Hi DyslexicDog, Thanks for your reply. do you mean that I need to add another column to the database to hold the value or you mean creating a variable in php to hold this value?. I have a variable called $perpage which takes value from database and divides the total products by $perpage. I want the user to control this without updatin the $perpage value. Thanks Link to comment https://forums.phpfreaks.com/topic/104157-products-per-page/#findComment-533231 Share on other sites More sharing options...
DyslexicDog Posted May 5, 2008 Share Posted May 5, 2008 I mean both, if you keep that setting stored in your database you can apply it each time a user logs in. If you store that number to a session variable you can keep that variable set for every page the user visits if need be. Link to comment https://forums.phpfreaks.com/topic/104157-products-per-page/#findComment-533239 Share on other sites More sharing options...
art15 Posted May 5, 2008 Author Share Posted May 5, 2008 Thanks I will give it a try. Link to comment https://forums.phpfreaks.com/topic/104157-products-per-page/#findComment-533240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.