SELECT tb_tes.tgl as tgl,
tb_tes.mem_id as mem_id,
tb_tes.jml as tes_jml,
tb_tes.jml-sum( tb_mem_2.jml_aml ) as tambah,
tb_tes.jml=sum( tb_mem_2.jml_aml ) as sama_
FROM tb_tes
LEFT JOIN tb_mem_2
ON tb_tes.mem_id = tb_mem_2.mem_id
GROUP BY tb_tes.tgl, tb_tes.ref_id
INTO OUTFILE 'C:\\tes.txt'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\r\n'
kalau dijalan pada phpmyadmin tidak ada masalah,
file tes.txt ada pada drive C:\. namun kalau pada php,
kok nggak ada reaksi apa-apa yah mas ? error nggak ada,
apa pun nggak ada.
phpnya kayak gini :
<?php
require_once( '../opendb.php' );
$trans = "SELECT tb_tes.tgl as tgl,
tb_tes.mem_id as mem_id,
tb_tes.jml as tes_jml,
tb_tes.jml-sum( tb_mem_2.jml_aml ) as tambah,
tb_tes.jml=sum( tb_mem_2.jml_aml ) as sama_
FROM tb_tes
LEFT JOIN tb_mem_2
ON tb_tes.mem_id = tb_mem_2.mem_id
GROUP BY tb_tes.tgl, tb_tes.ref_id
INTO OUTFILE '/coba/tes.txt'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\r\n'";
$hasil = mysql_query( $trans );
?>
mohon bantuannya ya mas...