Jump to content

Help? Need help on project with templates involving mysql and php.


DiscoTrio

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...
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.