Knowledgebase

Extracting Data for Reporting Print

  • databasesphpmyadmin, databases, phpmyadmin, guide, howto, solution, zillionkinghost, hosting
  • 0

Getting information out.

WHY

Producing a customer list Analysing orders Auditing content Providing data to an accountant

THE SIMPLE METHOD

Run a SELECT in phpMyAdmin, then use the export option beneath the results.

Export as CSV, which opens in a spreadsheet.

WHAT TO SELECT

Only the columns you need. SELECT * returns everything, including columns nobody wants.

Add a WHERE clause to restrict the rows: a date range, a status, a type.

JOINING TABLES

Most useful data spans tables. Orders in one, customer details in another.

A JOIN combines them. If you are not comfortable writing one, the application's own export is frequently easier.

THE PRIVACY POINT

An extract of customer data is personal data. Do not leave the file on the server where it might be reachable, and delete it when finished.

A customer list in a web-reachable folder can be taken by anyone who guesses the URL.

THE SAFER ROUTE

Most applications have reporting and export built in. Use it before writing SQL.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot