SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using HTML in a database??

    When using a program such as Mysql or Access, and you want to use html in a particular column for a field, what are the attributes that must be set. Like, CHAR, INT, TEXT, MEDIUMTEXT, etc..

    Thanks
    Bryan

  2. #2
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For Access, you need to use a "Memo Field" which is essentially a field type for large blobs of text (up to 62K chars or something I think).
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark

  3. #3
    Vermicious Knid moncur's Avatar
    Join Date
    May 2003
    Location
    Salt Lake City, UT
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In MySQL, I usually use a TEXT field for HTML content. You can use CHAR or VARCHAR if the content will be less than 255 characters - but keep in mind that a single <a> tag with a long URL could fill that up.

  4. #4
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I didn't know the limits of CHAR and VARCHAR, which brings up another point. What does VARCHAR stand for?

  5. #5
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    varchar stands for 'variable characters'.

    here's sometihng about char and varchar

    http://www.mysql.com/doc/en/CHAR.html

    check out the table down the page...

  6. #6
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    More accurately, "variable-length character".

  7. #7
    SitePoint Addict FizixRichard's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    372
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    in mySQL I use a mediumtext field myself. However I dont believe you can set details such as max and minimum length etc.


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
  •