Results 1 to 3 of 3
  1. #1

    Default Mysql CONCAT help please

    Well, I think its the CONCAT I need ......

    The 'products' table contains a field called 'product_image', which contains the image file - xxxx.jpg, yyyy.gif etc.

    Now, I've sucessfully imported 11000 rows into this table from another database, using EasyPopulate, but the imported image files are without the extension (.gif), so I need to add that to cells that don't have it.

    So, a mysql command to do this, please -

    ie. if text in cell does not contain a '.', append '.gif' to the text. Do this for the whole 'products_image' column.

    Any takers?

    Thanks
    Pa

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

    Default Re: Mysql CONCAT help please

    Code:
    update products set products_image = concat(products_image, '.gif') where products_image not like '%.%' and products_image != '';
    .

    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

    Default Re: Mysql CONCAT help please

    That looks good.
    Thanks DB

 

 

Similar Threads

  1. Please Help mySQL Emergency
    By Miff in forum Basic Configuration
    Replies: 1
    Last Post: 8 Sep 2010, 11:33 AM
  2. My dog ate MySQL please help!
    By medragon in forum Installing on a Windows Server
    Replies: 4
    Last Post: 21 Jul 2008, 06:17 AM
  3. Problems after MYSQL upgrade - Please help
    By gosvald in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 12 Jul 2007, 09:20 PM
  4. mySql Error (PLEASE HELP!)
    By yellowdaises in forum General Questions
    Replies: 4
    Last Post: 21 Feb 2007, 09:21 PM
  5. mySQL is searching VERY SLOW.... please help
    By jeffmic in forum General Questions
    Replies: 7
    Last Post: 14 Feb 2007, 04:20 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
  •  
disjunctive-egg