header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="MyXls.xls"');#ª×èÍä¿Åì
?>
Query String
include "config_inc.php";
//if ($_SESSION[user]!="meawcom@gmail.com" && $_SESSION[user]!="pond@magicfortress.net") {die("äÁè͹ØÒµãËéà¢éÒ");}
$a1="select * from presenter";
$rs = mysql_query(stripslashes("$a1")) or printf(mysql_error());
$nrow = mysql_num_rows($rs);
$ncol=mysql_num_fields($rs);
echo "";
for ($j=0 ; $j< $ncol ; $j++){
echo "".mysql_field_name($rs , $j)." | ";
}
echo "
";
for ($i=0;$i<$nrow ; $i++) {
echo "";
for ($j=0 ; $j < $ncol ; $j++) {
echo "".mysql_result($rs , $i , $j)." | ";
}
}
echo "
";
?>