Buying Need database tables converted to csv or xml

Discussion in 'Programming' started by tyankee, Jan 30, 2011.

  1. #1
    i have a classifieds database and am moving to a new script which utilizes a new database and need data reformated from the old database into a CSV file that i will upload into the new database. There is one main listings table and 3 other tables that need to be read to pull off a few fields.

    Here are the specs for the CSV file:

    id - from the MTOlistings table
    user_id - from the MTO listings table
    category_id - leave blank

    package_id - if 'featured' = 1 on MTOlistings table, then package 3 else package 4 EXCEPT if the maxlist from the MTOusers table is blank. If the maxlist from the MTOusers table is blank, then if 'featured' is a 1, package is a 1 else package is a 2

    usr_pkg - leave blank

    date_added - added from the MTOlistings table (convert format)

    date_expires - use today's date + 2years

    title - combine model_year, make, and model from MTOlistings

    description - from MTOlistings

    price - from MTOlistings

    currency - always use $

    city - from MTOusers

    zip - leave blank unless you can do a lookup on the city somehow.

    meta_description - combine model_year, make, model and category from MTOlistings

    meta_keywords - user model from MTOlistings

    sold - check status on MTOlistings - if 1, set to 0 - if 2 or 3, set to 1

    rented - leave blank

    viewed - from 'viewed' on MTOlistings

    user_approved - set to 1

    active - check status on MTOlistings - if 1, set to 1 - if 2 or 3, set to 0

    pending - set to 0

    featured - copy from MTOlistings

    highlited - set to 0

    priority - set to 0

    video - leave blank

    rating - set to 0

    language - set to 'eng'

    bodystyle - leave blank

    year - model_year from MTOlistings

    mileage - from MTOlistings

    transmission - from MTOlistings

    fuel - from MTOlistings

    doors - from MTOlistings

    color - from 'exterior' on MTOlistings

    engine_size - from MTOlistings

    horsepower - - from MTOlistings

    condition_vehicles - 'cond' from MTOlistings

    vehicle_features - leave blank

    state - use 'location' on MTOlistings and look up state on MTOlocations

    google_map - leave blank

    pictures - take listid from MTOlistings and read MTOimages and put all images into this field separated by a

    comma. the image name should be added to http://www.mustangtraderonline.com/images/listings/
    for example - if the image names you find on MTOimages are 124888822222.jpg and 1248888222333.jpg, then
    the output to this field would look like this - httptraderonline.com/images/listings/124888822222.jpg,httptraderonline.com/images/listings/1248888222333.jpg


    date_formatted - use 'added' from MTOlistings and convert

    date_expires_formatted - use today's day + 2 years.

    expired - set to 0

    category - leave blank

    plan - if 'featured' = 1 on MTOlistings table, then set to 'Featured Ads' else 'Standard Ads EXCEPT if the

    maxlist from the MTOusers table is blank. If the maxlist from the MTOusers table is blank, then if

    'featured' is a 1, set to 'Dealer Featured Ads' else 'Dealer Standard Ads'

    plan_amount - if 'featured' = 1 on MTOlistings table, then set to 28 else set to 18 EXCEPT if the maxlist from the MTOusers table is blank. If the maxlist from the MTOusers table is blank, then if 'featured' is a 1, set to $39.95 else set to $29.95

    username - from MTOusers combine first and last name.

    pending_package - set to 0

    invoice - start numbering from 1 and add 1 for each new listing record

    price_formatted - price from MTOlistings formated with a $ and commas - e.g. original field 23500 converts to $23,500

    stock - user id from MTOlistings

    date_formatted - use 'added' from MTOlistings and convert

    date_expires_formatted - use today's day + 2 years.

    expired - set to 0

    category - leave blank

    plan - if 'featured' = 1 on MTOlistings table, then set to 'Featured Ads' else 'Standard Ads EXCEPT if the maxlist from the MTOusers table is blank. If the maxlist from the MTOusers table is blank, then if 'featured' is a 1, set to 'Dealer Featured Ads' else 'Dealer Standard Ads'

    plan_amount - if 'featured' = 1 on MTOlistings table, then set to 28 else set to 18 EXCEPT if the maxlist from the MTOusers table is blank. If the maxlist from the MTOusers table is blank, then if 'featured' is a 1, set to $39.95 else set to $29.95

    username - from MTOusers combine first and last name.

    pending_package - set to 0

    invoice - start numbering from 1 and add 1 for each new listing record

    price_formatted - price from MTOlistings formated with a $ and commas - e.g. original field 23500 converts to $23,500

    stock - user id from MTOlistings


    Please PM me a quote for this job.. Need is as soon as possible. I am only online from 12 noon to 12 midnight Mountain Standard time in the USA. So if you are not able to communicate during those times, please do not bid.

    thanks.
     
    Last edited: Jan 30, 2011
    tyankee, Jan 30, 2011 IP
  2. tyankee

    tyankee Well-Known Member

    Messages:
    1,023
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    150
    As Seller:
    100% - 3
    As Buyer:
    100% - 0
    #2
    Here are the 4 tables involved:

    main table MTOlistings
    id userid location user_type added updated expire user_expire viewed images hide featured status pending stock vin model_year make model cond category category2 mileage mileage_alt price sale price_alt exterior interior doors fuel drive engine trans top_speed horsepower torque towing features description tagline link_url link_text ebay_url

    MTOusers
    id first_name last_name user_type location city state last_login username password email phone contact maxlist expire listings status hide pending

    MTOlocations
    id listings name email url phone fax address address2 city state zip country hide

    MTOimages
    id listid fname
     
    tyankee, Jan 30, 2011 IP
  3. Mareshal

    Mareshal Member

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Did you find someone for this job?
     
    Mareshal, Jan 30, 2011 IP
  4. militarysmurf

    militarysmurf Member

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    40
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Email sent, thanks!
     
    militarysmurf, Jan 31, 2011 IP