voxxtelum Posted February 5, 2008 Share Posted February 5, 2008 I am making a site and in the database there is a table which has a list of links and their respective description, category, etc. On the site, the list is printed into an HTML table which can be sorted, etc. by the user. The only thing I can't get though is that when a person clicks on the link, I want the link to not show up again the next time the HTML table is rendered. Is there an easy way to do this? Any responses would be greatly appreciated. Thanks in advance, Michael Quote Link to comment https://forums.phpfreaks.com/topic/89495-question-involving-tables-and-links/ Share on other sites More sharing options...
haku Posted February 5, 2008 Share Posted February 5, 2008 You have to save the fact that the person clicked on the link. You can save it as a cookie, a session variable, a get variable, or in the database. Whichever you choose is up to you. Then, you can use that variable a few ways - you can set your database queries to have the condition that whatever you are using to qualify your links doesn't equal the variables you have saved, or you can pull everything out of the database, and before each link is printed out, it checks itself against the list of links that have already been clicked. The second option isn't very efficient though, and you would be better off tailoring your database query to only pull the information you need out of the database. Quote Link to comment https://forums.phpfreaks.com/topic/89495-question-involving-tables-and-links/#findComment-458397 Share on other sites More sharing options...
voxxtelum Posted February 5, 2008 Author Share Posted February 5, 2008 Thanks for the response. There will be many (75-100 variable) links in the table at a time. What I have come up with so far: after the user clicks on a link, they click a button to signify they clicked on the link, which then adds to another table, an id, the user's user id, and the link id of the one they clicked. Is there a way I can use that data to tailor the request to the database to call the links? I am sorry if I am missing something that is really easy, I just have been working on this far too long and I am thinking way too much. Thanks again, Michael Quote Link to comment https://forums.phpfreaks.com/topic/89495-question-involving-tables-and-links/#findComment-458428 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.