Results 1 to 16 of 16
  1. #1
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    What Field Types to use for Images and Links in Data Base Table?
    Hi All,

    What Field Types (not Field Titles) should I use for Images and Links in Data Base Table?... Should I just use the Field Type TEXT, VARCHAR, or what?

    Thanks for Your Help and Time.
    Love You,
    HumbleFish

  2. #2
    The Thin White Duke PreacherMan's Avatar
    Join Date
    April 22nd, 2005
    Posts
    329
    Well most browsers only support 256 characters in a URL so the safest type I reckon is VARCHAR ( 255 characters ).

  3. #3
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks PreacherMan,

    Would it be alright to just use text for those (hate to miss by just on letter)?

    Anyone else?

  4. #4
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    Using "varchar" would be more efficient than "text".
    Tim
    consultant by day, affiliate by night

  5. #5
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks infospongellc,

    infospongellc: Using "varchar" would be more efficient than "text".
    Would there be something better to use thay "varchar"?

  6. #6
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    char(255) is more efficient than varchar (in mysql, at least).

    Quote Originally Posted by mysql documentation
    For MyISAM tables that change a lot, you should try to avoid all variable-length columns (VARCHAR, BLOB, and TEXT). The table uses dynamic record format if it includes even a single variable-length column. See Chapter 14, MySQL Storage Engines and Table Types.

  7. #7
    Not Verif-Lidated infoTim's Avatar
    Join Date
    January 18th, 2005
    Location
    Sunny Florida
    Posts
    1,021
    Starting to remember why I don't use mySQL anymore. :-)
    Tim
    consultant by day, affiliate by night

  8. #8
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks FFoc, and since You seem to be that rare person that actually reads the manual (I keep telling myself readings good ), I was wondering if You could please give me a list of what I should be using for the different field types?

    infospongellc,

    So what do You use now?

  9. #9
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    I use 'TEXT' for long description fields, 'CHAR(255)' for url and product category fields, and 'SMALLINT' for most of my 'key' fields.

    In general, use the smallest type you can get away with for a given column in your table.

  10. #10
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks FFoc, I appreciate all Your help.

    Quote Originally Posted by FFoc
    'CHAR(255)' for url and product category fields, I use 'TEXT' for long description fields, 'CHAR(255)' for url and product category fields, and 'SMALLINT' for most of my 'key' fields.
    I should use CHAR(255) for my images too?

    Please define 'key' fields?

  11. #11
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    Quote Originally Posted by HumbleFish
    I should use CHAR(255) for my images too?
    Yep - they're urls, ain't they?

    Please define 'key' fields?
    These are fields you index off of. Like SKU or ID..

  12. #12
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks FFoc,

    Things seem to be getting clearer now.

    Also wondering if You can index Keywords instead of Numbers?... Like say I have a link that says "Crosses" is there a way to make it (when someone clicks on it) bring up all the products from the data base that has the word "Crosses" in it?

  13. #13
    Affiliate Marketer Rogi's Avatar
    Join Date
    January 18th, 2005
    Location
    Melbourne
    Posts
    415
    you can do that with an sql query, ie somwhere you have "and productname like '%Crosses%' "


    (assuming productname is the title of the product name field).

  14. #14
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    Keys are different - they need to be unique, which is why SKU is a reasonable field to index on.

    Do like Rogi said..

  15. #15
    ABW Ambassador HumbleFish's Avatar
    Join Date
    January 18th, 2005
    Location
    Arizona
    Posts
    680
    Thanks Rogi, and FFoc,

    I got some reading to do.

    Take care and Love You,
    HumbleFish

  16. #16
    mega crap martyogelvie's Avatar
    Join Date
    January 18th, 2005
    Location
    Atlanta
    Posts
    608
    I use text as the field type and point to the name of the image file....

    ie.

    ../images/filename.jpg

  17. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. AMWSO Site Down For Data Base Upgrade
    By Chris - AMWSO in forum AMWSO
    Replies: 0
    Last Post: October 20th, 2007, 06:58 AM
  2. Using data from another table in a repeating recordset?
    By Taurus in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: January 1st, 2003, 08:07 PM

Posting Permissions

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