戻る      schedule_download.php     

《PHP言語 /schedule_download.php》

<?php
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment;filename=schedule.txt");
require_once("DB.php");
$db=DB::connect("sqlite://localhost/schedule.sqlite");
$stt=$db->prepare("SELECT * FROM schedule ORDER BY s_date,s_time");
$rs=$db->execute($stt);
while($row=$rs->fetchRow(DB_FETCHMODE_ASSOC)){
print(mb_convert_encoding($row['title'],"SJIS","auto")."\t");
print($row['s_date']."\t");
print($row['s_time']."\t");
print(mb_convert_encoding($row['memo'],"SJIS","auto")."\r\n");
}
$db->disconnect();
?>


《PHP言語 /DB.php》


<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* Database independent query interface
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Database
* @package DB
* @author Stig Bakken <ssb@php.net>
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: DB.php,v 1.88 2007/08/12 05:27:25 aharvey Exp $
* @link http://pear.php.net/package/DB
*/

/**

・・・・・~

/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/

?>

 


《PHP言語 /schedule.sqlite》

データファイル