|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/ -> mysqldb_exporttbl.php
1 <?php
2 //////////////////////////////////////////////////////////////////////////////////////
3 // coder: cthorn
4 // mysqldb_exporttbl.php
5 //
6 /************************************************************************
7 PCCS MySQLDatabase Admin Tool
8 Copyright (C) 1999 Chauncey Thorn
9
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
23 **************************************************************************/
24 require('login.php');
25 require('incs/global.vars.php');
26 require('incs/dbconnect.php');
27 require('incs/lang_eng.php');
28
29 if($action == "export"):
30
31 mysql_select_db($dbname);
32
33 $dirpath = exec("pwd");
34 $filename = $dirpath . "/exports/" . $dbname . "_" . $tblname . ".csv";
35
36 $query = "SELECT * INTO OUTFILE '$filename' FIELDS TERMINATED BY ',' FROM
37 $tblname";
38
39 $res = mysql_query("SELECT * INTO OUTFILE '$filename' FIELDS TERMINATED BY ',' FROM
40 $tblname") or die("ERROR: $query" . mysql_error());
41
42 endif;
43 ?>
| |