fawcett44 Posted December 6, 2007 Share Posted December 6, 2007 Hi, I have created a form which users can input text into various fields in a database. I have seperately created a different page which retrieves these records and puts them into a table, This all waorks fine including putting the users name who submitted the form, into the table next to the relating record. Is it possible to, when retrieving the records it displays each record as a different colour text, also is it possible to retrieve the record and relate a colour to a user so each user has a different colour? Any help/tips are greatly appreciated. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 6, 2007 Share Posted December 6, 2007 Yes, you can store a color in the user table and use it everytime if you want. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 6, 2007 Share Posted December 6, 2007 You might want to check if the color is already in use, and yes you can do so by just putting the color chosen from the registration, or maybe updated or changed later on into a coloumn called "user_color", or anything you want. Quote Link to comment Share on other sites More sharing options...
fawcett44 Posted December 8, 2007 Author Share Posted December 8, 2007 Would the colour within the table have to be stored as Hex? Also how would i get the colour/hex from the table into a tag if there are multiple rows? (E.G i am attempting to give users a different colour to other users within a message board) Thanks for your help. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 8, 2007 Share Posted December 8, 2007 You can store it anyway you like. But if you are going to have a lot, may want to consider themes instead. Quote Link to comment Share on other sites More sharing options...
fawcett44 Posted December 8, 2007 Author Share Posted December 8, 2007 Ill probably have about 10 colours. The problem is getting the colour from the Dbase to the page tag. Would it retrieve the colour from Dbase and put into variable, then insert variable into tag???? I just dont know. Any ideas would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 8, 2007 Share Posted December 8, 2007 Its just like any other variable you pull from a database. Don't treat it any different. 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.