2
$file=$_FILES['import']['name'];
$path='C:/Documents and Settings/Administrator/My Documents/Downloads'.$file;
echo $file.'hi';
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'test1';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
// Dump table.
// $query = "DROP TABLE location";
// $result = @mysql_query ($query); //runs the query
// if (mysql_affected_rows() == 1) { //if it ran ok.
//
// echo '<p>The database was updated</p>';
// exit();
//
// } else { // if did not run ok.
// $message = '<p>The database was not updated</p>';
// } // end table dump.
// Create table call_in.
// $query = "CREATE TABLE location1(id int(255) NOT NULL AUTO_INCREMENT,lat VARCHAR(100),long VARCHAR(100),PRIMARY KEY(id))";
$query="CREATE TABLE `test1`.`location1` (
`id` INT(255) NOT NULL AUTO_INCREMENT ,
`lat` VARCHAR(1000) NOT NULL ,
`long` VARCHAR(1000) NOT NULL ,
`speed` VARCHAR(1000) NOT NULL ,
`time` DATETIME NOT NULL ,
`address` VARCHAR(1000) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;";
$result = @mysql_query ($query); //runs the query
$query = "LOAD DATA LOCAL INFILE 'D:/technoho_360gps-sqldump.sql' INTO TABLE `location1` FIELDS TERMINATED BY '\', \'' LINES TERMINATED BY '\n' STARTING BY 'INSERT'";
$result = @mysql_query ($query); //runs the query
echo 'hello';
mysql_close(); // close the database connection.
}
在此代碼中,我給出了靜態系統路徑,但我希望從文件標記獲得系統文件路徑。從文件標記中獲取系統文件路徑
什麼文件標籤。?請詳細解釋。 – Chandresh
我想要這個文件標籤選擇的文件的路徑。 – srbhbarot