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'
<?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 );
?>
<select name="nm_guru"> <?
include "koneksi.php";
$tampil=mysql_query("select * from data_guru");
while($data=mysql_fetch_array($tampil))
{
echo "<option value=$data[nm_guru]>$data[nm_guru]</option>";
}
?></select>
<input type="text" name="mapel" value="<? echo $data['mapel']; ?>">
//koneksi
<?php
$host="localhost";
$user="root";
$pass="";
$db="komen";
$sql=mysql_connect($host,$user,$pass) or die("gagal konek".mysql_error());
$select=mysql_select_db($db) or die ("database tidak ada" .mysql_error());
?>
//eksekusi form komentar
<?
require_once ('koneksi.php');
if($_POST) {
$publish = $_POST['tulis'];
$ins="insert into post (post) values ('$publish')";
$query=mysql_query($ins);
?><script language="JavaScript">document.location='index.php'</script><?
}
else {
echo "gagal input";
};
?>
//form komentarnya
<form action="komentar.php" method="post">
<textarea name="tulis"></textarea><br>
<input type="submit" value="publish" name="post">
</form>
<?php
include "koneksi.php";
$result = mysql_query("select * from post order by date DESC");
while ($post = mysql_fetch_array($result)){?>
<p><? echo $post['post']?></p>
<? echo $post['date']?>|<a href="index.php?id=<? echo $post['id'];?>">komentar</a>
<?}
if ($_GET) {?>
<form action="komentar.php" method="post">
<textarea name="tulis"></textarea><br>
<input type="submit" value="publish" name="post">
</form>
<?}
?>