Hi,
Can you help me make this php as a bat file?
<?php
$connection = mysql_connect("localhost", "root", "") or die("Cannot connect to MySQL server: " . mysql_error());
$db_selected = mysql_select_db('metrix', $connection);
$data = mysql_query("LOAD DATA LOCAL INFILE 'C:\\\Program Files\\\Metrix Statistical Server\\\dcomb_drop.CSV'
INTO TABLE metrix.drops
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(BSCID,Cellid,Seiz,Drps,dropflag,Total,Dlta,RF,Oth,Traff,trafflag,IHFL,ihfflag,TCD,TCA,SDD,SDA,TAVL,tchaflag,Drate,date)
SET date = CURDATE()")
or die(mysql_error());
?>
Re: PHP in batfile
You can use mysql.exe - command line client to MySQL database and execute the SQL statement with it. So, it may look like the the following:
load.data.bat
c:\path\to\mysql.exe -u root metrix < query.sql
where query.sql contains the SQL statement to execute.
You can read more about how to execute queries from the command line at
http://dev.mysql.com/doc/refman/5.0/en/batch-commands.html
Got it..... no prob.
Got it..... no prob.