1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Buying Several Mysql command command needed urgently

Discussion in 'Programming' started by nocser, Jul 3, 2010.

  1. #1
    I need someone to write a Mysql command line to update my mysql table. Please pm me for your price.

    Here is what the command need to do. I explain the things here is a spreadsheet as I exported the table to csv.

    row 1, column A:
    <img src="http://www.domain.com/upimage/013693.jpg" />
    <img src="http://www.domain.com/upimage/013655.jpg" />
    <img src="http://www.domain.com/upimage/013665.jpg" />

    Row 1, column B:
    1_A_12345.jpg

    Row 1, column C:
    1_A_23343.jpg

    Row 1, column D:
    1_A_45366.jpg

    My request is to update Row 1, column A as below:
    <img src="http://www.domain.com/images/1_A_12345.jpg" />
    <img src="http://www.domain.com/images/1_A_12343.jpg" />
    <img src="http://www.domain.com/images/1_A_12366.jpg" />
    SEMrush

    Please take note file name:
    1_A_12345.jpg
    | | |
    | | |___> This is file name
    | |
    | |______> This is fixed
    |
    |________> Row number
     
    nocser, Jul 3, 2010 IP
    SEMrush
  2. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    This should be possible writing the following query. :)

    UPDATE `TableName`
    SET `TableName`.`columnA`=concat('<img src="http://www.domain.com/images/', '\"' ,`TableName`.`columnB`, '\" />', '  ' ,
    '<img src="http://www.domain.com/images/', '\"' ,`TableName`.`columnC`, '\" />', '  ' ,
    '<img src="http://www.domain.com/images/', '\"' ,`TableName`.`columnD`, '\" />' )
    
    
    PHP:
    Do let me know if you need further assistance or if you have trouble understanding the query. :)
     
    killerj, Jul 4, 2010 IP