mysql INTO OUTFILE没有结果

我正在尝试从mysql表中导出csv文件,但是什么也没发生。我尝试了不同的方法,但是根本没有生成csv文件。怎么了?这是我尝试过的最新代码:

<?php
$link = mysqli_connect("db", "user", "pw", ""); 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
} 
// Attempt select query execution
$sql = "SELECT update_date, contract_id, open, high, low, close, sett, est_volume FROM prices WHERE market_id='10' AND act_contract='act'
INTO OUTFILE 'tmp_gc.csv'
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'";
// Close connection
mysqli_close($link);

?>
评论