Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New Coder
    Join Date
    Apr 2010
    Posts
    55
    Thanks
    0
    Thanked 4 Times in 4 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    That answer had no logic, if you wont help me, dont reply it /end

    If someone could give sugestions, i would be thankfull.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •