Completed

PHP to extract data from mysql

This project was successfully completed by kjanssens for $30 USD in a day.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$30 - $250 USD
Completed In
1 day
Total Bids
40
Project Description

I have to create a php file that will be setted as cron.
this cron will generate two csv files extracting datas from a mysql database (it's a wordpress installation).

-------
CSV 1

header:
ID;ragione sociale;indirizzo;nome;email;telefono;prodotto;licenze;db;erp;commento;newsletter;privacy;IP;referrer;data;lingua;mail inviata

rows:
csv will extract all datas from blk_rg_lead table that has form_id = 73 or 80.

fields:
ID --> field id from blk_rg_lead table
ragione sociale --> field with field_number = 1 and with lead_id = previous field, from blk_rg_lead_detail table
indirizzo --> field with field_number = 37 and with lead_id = previous field, from blk_rg_lead_detail table
nome --> field with field_number = 2 and with lead_id = previous field, from blk_rg_lead_detail table
email --> field with field_number = 3 and with lead_id = previous field, from blk_rg_lead_detail table
telefono --> field with field_number = 29 and with lead_id = previous field, from blk_rg_lead_detail table
prodotto --> field with field_number = 39 and with lead_id = previous field, from blk_rg_lead_detail table
licenze db --> field with field_number = 6 and with lead_id = previous field, from blk_rg_lead_detail table
erp --> field with field_number = 32 and with lead_id = previous field, from blk_rg_lead_detail table
commento --> field with field_number = 41 and with lead_id = previous field, from blk_rg_lead_detail table
newsletter --> field with field_number = 40 and with lead_id = previous field, from blk_rg_lead_detail table
privacy --> field id from blk_rg_lead table
IP --> field ip from blk_rg_lead table
referrer --> field source_url from blk_rg_lead table
data --> field date_created from blk_rg_lead table
lingua --> "it" if field form_id from blk_rg_lead table is = 73, "it" if field form_id from blk_rg_lead table is = 80
mail inviata --> OK

--------
CSV 2

header:
"ID";"Titolo";"Nome";"Cognome";"E-mail";"Telefono";"Fax";"Info via mail";"Aree di interesse";"Come siete venuti a conoscenza";"Posizione";"Azienda";"Settore attività";"Fatturato";"Numero dipendenti";"Certificati (sÏ/no)";"Prodotto di cui si richiede il download";"Tipo di certificazione";"Indirizzo";"Località";"CAP";"Provincia";"Nazione";"Attivo";"Scadenza"

rows:
csv will extract all datas from blk_users table

fields:
ID --> field ID from blk_users table
Titolo --> no data to import
Nome --> field with meta_key = first_name and with user_id = previous field, from blk_usermeta table
Cognome --> field with meta_key = last_name and with user_id = previous field, from blk_usermeta table
E-mail --> field user_email from blk_users table
Telefono --> field with meta_key = user_telefono and with user_id = previous field, from blk_usermeta table
Fax --> no data to import
Info via mail --> no data to import
Aree di interesse --> no data to import
Come siete venuti a conoscenza --> no data to import
Posizione --> no data to import
Azienda --> field with meta_key = user_company and with user_id = previous field, from blk_usermeta table
Settore attività --> no data to import
Fatturato --> no data to import
Numero dipendenti --> no data to import
Certificati (sì/no) --> no data to import
Prodotto di cui si richiede il download --> no data to import
Tipo di certificazione --> no data to import
Indirizzo --> no data to import
Località --> no data to import
CAP --> no data to import
Provincia --> no data to import
Nazione --> no data to import
Attivo --> SI if field with meta_key = user_meta_user_status and with user_id = previous field from blk_usermeta table is = active, else NO
Scadenza --> no data to import

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online