Suppose I have a table in SQL named 'myTable'. It contains 3 columns; 'id', 'lat' and 'lng'
| id | lat | lng |
|------+--------+--------|
| 1 | 1.11 | 1.22 |
| 2 | 2.11 | 2.22 |
| 3 | 3.11 | 3.22 |
| 4 | 4.11 | 4.22 |
| .... | .... | .... |
I want to export it to CSV. I expect the result become like this in the CSV file :
| | A | B | C | D | ....
------+-----+------+--------+------+--------
| 1 | 1.11 | 2.11 | 3.11 | 4.11 | .... //contains 'lat'
| 2 | 1.22 | 2.22 | 3.22 | 4.22 | .... //contains 'lng'
Can you help me? I'm using PHP. Thanks a lot.