Quick PHP or Mysql statement
4562
£20/hr(approx. $25/hr)
- Posted:
- Proposals: 5
- Remote
- #96267
- Archived
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.
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.
Russell B.
100% (10)Projects Completed
27
Freelancers worked with
24
Projects awarded
42%
Last project
14 Jan 2023
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies