This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$intro = <<<TEXT | |
Helper command to export data for an arbitrary mysql query into a CSV file. | |
Especially helpful if the use of "SELECT ... INTO OUTFILE" is not an option, e.g. | |
because the mysql server is running on a remote host. | |
Usage example: | |
./mysql2csv --file="/tmp/result.csv" --query='SELECT 1 as foo, 2 as bar;' --user="username" --password="password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# hello | |
# this is pure crap, don't even think about using it | |
# it doesn't filter input vars or contain ANY error handling at all | |
# i wrote this while putting a kid to bed in, january 2016 | |
# i repeat: do not use this script | |
# i am peder@earthpeople.se, a ceo - not a real developer | |
# prerequisites | |
# you need an account at mathem |