MySql Query in magento through phpmyadmin

Discussion in 'Programming' started by travellerspoint, May 10, 2012.

  1. #1
    I am looking for sql query to update my magento database field all at once. This is my database name: 'test1' I need to change description of all products under category eg: 'categ1' , so what query should I do to update all products description to eg:'hello world, this is testing' under category 'categ1'. Please share your query....

    All products description must be changed to 'hello world, this is testing' after query update.

    Thanks!
     
    travellerspoint, May 10, 2012 IP
  2. e-abi

    e-abi Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    38
    #2
    Yes it does not include categories.
    Categories are displayed as comma separated values in catalog_product_entity.category_ids field.
    Also pay attention if you have table prefix or not.

    And read more about Magento database structure here:
    http://alanstorm.com/magento_advanced_orm_entity_attribute_value_part_1
     
    e-abi, May 10, 2012 IP
  3. travellerspoint

    travellerspoint Banned

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    I wanna update description of all products under my category id:9 i.e categ name='Gizmo' not by product id.
     
    travellerspoint, May 10, 2012 IP
  4. e-abi

    e-abi Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    38
    #4
    That part is harder and as I said, category_id can be referenced from table catalog_product_entity.
    If you have some SQL knowledge, it should be easy. I am not going to do all job for you.
     
    e-abi, May 10, 2012 IP