SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: 255 max char?

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a variable type that can hold more than 255 chars (well I know there is, I just dont know what it is) and is there a special way it ahs to be defined or used?

    Thanx

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In a database or regular old php? In a database a field type of text or blob can hold more, but I think you are talking about passing vars using GET and limit of GET string size, am I right?

    If so you probably need to use POSt to get thos long variables through.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im using PHP and MYSQL

    right now I have a field in my database that is varchar(255)
    but i want it to be able to hold more information
    Im not using get or post methods

  4. #4
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i dotn think..



    Im using my sql query to update

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A field type of text or blob is what you want, and if you are not storing binary data( ie, images...) then text is fine. It can hold quite a bit, I am not sure what the limit is but I know its a lot more than varchar.

    From the MySQL manual

    TEXT can hold 65535 characters
    MEDIUMTEXT can hold 16777215 characters
    LONGTEXT can hold 4294967295 characters
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tanx man...er..cat

  7. #7
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it defined as...

    variablename text

    ? that simple?

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is the design of the table, it doesn't have anything to do with variables. When you insert data in to the db, if the db tables column length is not long enough it will truncate the data at the last character for the column width.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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