DiscoTrio Posted November 29, 2009 Share Posted November 29, 2009 I'm having a hard time explaining what I want but basically here is what I have in place: -Database with 500 members signed up and using under a table called 'users' -Php page that people click a link and it changes the field 'template' to the corresponding button. And what I want to know is, is there a way that I can record what templates they already chose into another filed on 'users' like this: (1,2,7,4) and so on. But it needs to add on over time from when someone decides to switch again. To help get more of an idea visit this: www.robloxianjournal.com/templatesearch.php Id be happy to give more info thanx. Quote Link to comment Share on other sites More sharing options...
cags Posted November 30, 2009 Share Posted November 30, 2009 It's generally frowned upon to store multiple values into a single field. The way around this is to use another table (generally named something like user_templates), that will hold a field for user_id and a field for template_id. When a user uses a template you can SELECT * FROM user_templates WHERE user_id=$user_id AND template_id=$template_id. If you get no results then it's not been used before so you can INSERT a new row. Quote Link to comment Share on other sites More sharing options...
plznty Posted November 30, 2009 Share Posted November 30, 2009 I wouldn't recommend doing on what you plan on doing. However depending on the popularity of the site and if its an easy solution for you ide stick to it. It really depends on site usage and how many templates available on how you should do it. Quote Link to comment Share on other sites More sharing options...
DiscoTrio Posted December 12, 2009 Author Share Posted December 12, 2009 I need a way for this reall soon, Im getting about 30new people signed up on the site a day, have an average of 15 people on at a time non-stop. And our site is not complete.... Quote Link to comment Share on other sites More sharing options...
DiscoTrio Posted December 12, 2009 Author Share Posted December 12, 2009 Can I get a suggestion on how to go about this then? Quote Link to comment Share on other sites More sharing options...
blueman378 Posted December 12, 2009 Share Posted December 12, 2009 if you want to do it the way you do, you will need one query to get the previous value, and then another query to update it. why do oyu want to do it this way? 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.