Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default increasing the field size of the "products_models" field in the "products" table

    Hi guys,

    I am using MySQL, and I'm having difficulty increasing the size of the products_model field in the products table. I need to increase it because the varchar max limit is only 255 (or 256, i forget), and that's not big enough for my needs. I need 510 atleast.

    I have tried dropping the table then creating it again with the field as

    > `products_model` text(510) default NULL,

    and leaving in the original key setting line

    > KEY `idx_products_model_zen` (`products_model`),

    and i also tried as a blob type but i get this error for both

    > BLOB/TEXT column 'products_model' used in key specification without a key length.

    because the field is used as a key i suppose. It works ok as long as i don't set it as a key, but it's probably needed since it's been set up that way.

    I know the field also exists in the table orders_products, though i don't know why as it would seem redundant to have it in both to me. Anyway, my plan was to change this field too once i had changed the one in the products table. In the meantime I don't see why this would be causing any referential integrity problems and so inhibit me changing the other table.

    Does anyone know the syntax for setting the key with a length in the table creation SQL, as the error message implies? Or any other way i can achieve this?

    My fingers are crossed as these forums have been seriously helpful on previous occasions.

    All the best!

    Bod

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: increasing the field size of the "products_models" field in the "products" table

    510 characters for a model number?


    http://dev.mysql.com/doc/refman/5.0/...ate-index.html
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table

    Nope. The products_models field is the field that contains the description of the product.

    Actually, that should read the products_model field, no plural on model. Sorry for any confusion.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: increasing the field size of the "products_models" field in the "products" table

    The products_model field is intended to be used for model-number info.
    Why aren't you using the products_description field for product descriptions ... in the products_descriptions table ?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table

    Thanks for your help so far!!

    I'm using the field that appears on the list of products. Have a look at www.uksportimports.com and have a look at any product to see how we use the field to display a set of bullet points about the product. It works fine with a large field on cart version 1.26d. Do you have any idea what other way we can display the bullet points like we are in 1.26d in the new upgraded 1.3.7 version?

    Best regards!

  6. #6
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table

    by which i mean have a look at any list of products to see how we use the bullet points.


  7. #7
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table


  8. #8
    Join Date
    Apr 2007
    Posts
    23
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table

    Just for the record, I solved the problem by using this line instead of a varchar version for the field in the table definition

    `products_model` text(1000) default NULL,

    and this line in the key specification section of the table definition

    FULLTEXT KEY `idx_products_model_zen` (`products_model`),

    It appears that in different tables the products_model field is of a different type and use, in one table it's used to post the actual unique model key, but others are used for a text description (and i wonder why it's duplicated across more than one table, maybe redundant or there might be a good reason). A little confusing for me, but i got there in the end.

  9. #9
    Join Date
    Jul 2009
    Location
    Arkansas
    Posts
    177
    Plugin Contributions
    0

    Default Re: increasing the field size of the "products_models" field in the "products" table

    Could you point me to some instructions on how to increase the character limit on the model number field? I think the default is 12 and I need to increase it to probably 18.

    Thanks
    Jim

 

 

Similar Threads

  1. Adding a "Size guide" link only if the "size" attribute is active in the product
    By dsided in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 7 May 2011, 01:55 PM
  2. Changing the Field "Manufacturer" to "Author"
    By Robynsveil in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Sep 2008, 11:50 PM
  3. I need to make the "company" field a required field
    By semaxd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 30 Jun 2008, 09:09 PM
  4. Replies: 0
    Last Post: 22 Dec 2007, 11:39 AM
  5. Inside the "Categories" box it says "New Products" and "All Products"...
    By john9 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Feb 2007, 07:55 AM

Posting Permissions

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