Quick PHP or Mysql statement

  • Posted:
  • Proposals: 5
  • Remote
  • #96267
  • Archived
Dan H.E-citius I.Richard B.Rien S.Umar B. have already sent a proposal.
  • 0

Description

Experience Level: Intermediate
HI.

I require the result of a MYSQL select within a select to be exported into separate CSV files.

I have two tables

TABLE_1
---------------------

<NAME> <ID>
ALPHA 1
BRAVO 2
CHARLIE 3
DELTA 4
ECHO 5


TABLE_2
-----------------
<ID> <FIRSTNAME> <SECONDNAME> <EMAIL>
1 RUSSELL BATCHELOR EMAIL@EMAIL.COM


I effectively want to create

ALPHA.CSV
BRAVO.CSV
CHARLIE.CSV
DELTA.CSV
ECHO.CSV

each file will hold the results of the select statement

SELECT *.TABLE_2, *.TABLE_1 WHERE TABLE_1.NAME = <THE FIRST LINE OF THE SELECT>

The ALPHA.CSV should look something like this
<ID> <FIRSTNAME> <SECONDNAME> <EMAIL> <NAME>
1 RUSSELL BATCHELOR XX@EMAIL.COM ALPHA

The BETA.CSV should look something like this
<ID> <FIRSTNAME> <SECONDNAME> <EMAIL> <NAME>
1 RUSSELL BATCHELOR XX@EMAIL.COM BETA

I have over 500 names in TABLE_1 I need to run this report daily, I do not wish to perform this manually, ie running a single report 500 times.

I have PHP and MYSQL running, I am happy to accept either PHP code or a MYSQL statement.

New Proposal

Create an account now and send a proposal now to get this project.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.