Skip to content

Instantly share code, notes, and snippets.

View Mutungi's full-sized avatar
🏠
Working from home

Mutungi Ian Mutungi

🏠
Working from home
View GitHub Profile
@Mutungi
Mutungi / export_csv.php
Created September 25, 2017 23:30 — forked from apocratus/export_csv.php
Export MySQL to CSV (php script)
<?php
/* vars for export */
// database record to be exported
$db_record = 'XXXXXXXXX';
// optional where query
$where = 'WHERE 1 ORDER BY 1';
// filename for export
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv';
// database variables