Wednesday, September 19th, 2007 11:38 PM
Functions to Export and import CSV data using PHP
//*Get the result of the query as a CSV stream.
function CSVExport($query) {
global $sql;
$sql_csv = $sql->getSqlHandle($query);
header("Content-type:text/octect-stream");
header("Content-Disposition:attachment;filename=data.csv");
while($row = mysql_fetch_row($sql_csv)) {
$row = $sql->_stripsls($row);
print '"' . implode('","',$row) . "\"\n";
}
exit;
}
[tags]php,export,import,csv,function[/tags]
3 Comments »
Friday, March 23rd, 2007 11:28 PM
Import/New Project
svn import <Folder> <Repository>
Online Repository Example
svn import Nexty https://nexty.svn.sourceforge.net/svnroot/nexty
Checkout
svn checkout https://nexty.svn.sourceforge.net/svnroot/nexty [<folder>]
Update
svn update
[tags]svn,subversion,version control,command,cli,import,checkout,update[/tags]
No Comments »
Saturday, March 17th, 2007 07:49 PM
This command can be used to backup MySQL database.
mysqldump -u <User> -p <Database name> [<Table name>] > backup.sql
This command will create a file ‘backup.sql’ that will have all the data of the Database. The <Table name> is optional.
The database can be restored from such a dump using the command
mysql -u <User> <Database name> < backup.sql
Example
I backup all the task in Nexty using this command.
mysqldump -u root Apps_Nexty > nexty.sql
This will create a file called ‘nexty.sql’ - which can be restored using the command…
mysql -u root Apps_nexty < nexty.sql
[tags]mysql,backup,import,export,restore,database,command,dump,sql[/tags]
1 Comment »