Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-16-2013, 04:08 AM   PM User | #1
paulocoré
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
paulocoré is an unknown quantity at this point
Change values to text

Hi there.

I'm trying to know how to change the values to a text, i'm coding one administrator panel, i've made one table called logs, and there will be a lot of columns one of them is called Rank, everytime users change the rank to Administrator at column Rank it will be 1, cant it be Administrator?

Last edited by paulocoré; 01-16-2013 at 04:19 AM..
paulocoré is offline   Reply With Quote
Old 01-16-2013, 11:28 AM   PM User | #2
alemcherry
New Coder

 
Join Date: Apr 2010
Posts: 55
Thanks: 0
Thanked 4 Times in 4 Posts
alemcherry is an unknown quantity at this point
Only you can answer it. This is your logic, you are the one interpreting the data in database to rights of users. I don't want to be harsh, but if you are asking such questions on a public forum, probably you are not qualified to do custom coding in PHP.
__________________
Hosting Reviews and Discounts: Bluehost Coupon and Hostmonster Coupon
alemcherry is offline   Reply With Quote
Old 01-16-2013, 04:13 PM   PM User | #3
paulocoré
New to the CF scene

 
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
paulocoré is an unknown quantity at this point
That answer had no logic, if you wont help me, dont reply it /end

If someone could give sugestions, i would be thankfull.
paulocoré is offline   Reply With Quote
Old 01-16-2013, 04:58 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
As stated, it is your data, and you can interpret it however you want. Personally, I would not call it Administrator as that would be at minimum char(13) or 8 *13 = 104 bytes. This is much more expensive than 4bytes required by an int, and if you are talking about usergroups, you can probably get away with a tinyint which is a single byte (giving you up to 256 possible values, or 255 excluding the 0). So if you were to do that, it would be 1/104'th the size for that record (depending of course on the property type and value, I'm just comparing it to the string "Administrator").

Instead, use the numerical value provided and join it to another table which has the text to display. Unless you need to store that data for whatever historical reasons, than you are much better off using the numerical value and joining in the data you need than to store the textual data it represents.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:34 AM.


Advertisement
Log in to turn off these ads.