 |
|
|  |
mySQL ÀÚ·á ¿¢¼¿,¿öµå,ÆÄ¿öÆ÷ÀÎÆ®·Î ´Ù¿î¹Þ±â |
|
|
 |
14³â Àü |
<?
//include_once("./_common.php");
//if (!$is_admin =="super")
// alert_close("ÃÖ°í °ü¸®ÀÚ ¿µ¿ª ÀÔ´Ï´Ù.");
//include "dbconfig.php";
$mysql_host = "localhost";
$mysql_user = "µðºñ ¾ÆÀ̵ð";
$mysql_password = "µðºñ ºñ¹Ð¹øÈ£";
$mysql_db = "µ¥ÀÌŸº£À̽º";
$dbconn = mysql_connect("$mysql_host","$mysql_user","$mysql_password") or die("µ¥ÀÌÅͺ£À̽º ¿¬°á¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.");
mysql_select_db($mysql_db, $dbconn);
$filename = 'ÆÄÀÏÀ̸§';
if ($ms =="excel"){
$g4[title] = "¿¢¼¿ ¹®¼ ´Ù¿î·Îµå";
header( "Content-type: application/vnd.ms-excel; charset=utf-8" );
header( "Content-Disposition: attachment; filename=".$filename.".xls" );
//header( "Content-Description: PHP4 Generated Data" );
} else if ($ms =="power"){
$g4[title] = "ÆÄ¿öÆ÷ÀÎÆ® ¹®¼ ´Ù¿î·Îµå";
header( "Content-type: application/vnd.ms-powerpoint; charset=utf-8" );
header( "Content-Disposition: attachment; filename=".$filename.".ppt" );
// header( "Content-Description: PHP4 Generated Data" );
} else if ($ms =="word"){
$g4[title] = "¿öµå ¹®¼ ´Ù¿î·Îµå";
header( "Content-type: application/vnd.ms-word; charset=utf-8" );
header( "Content-Disposition: attachment; filename=".$filename.".doc" );
//header( "Content-Description: PHP4 Generated Data" );
} else if ($ms =="memo"){
$g4[title] = "¸Þ¸ð ¹®¼ ´Ù¿î·Îµå";
header( "Content-type: application/vnd.ms-notepad; charset=utf-8" );
header( "Content-Disposition: attachment; filename=".$filename.".txt" );
} else {
header( "Content-type: application/vnd.ms-excel; charset=utf-8" );
header( "Content-Disposition: attachment; filename=".$filename.".xls" );
}
header( "Content-Description: PHP4 Generated Data" );
// °Ë»ö¾î¿¡ ´ëÇؼ ó¸®
$s_que="";
$temp=mysql_fetch_array(mysql_query("select count(*) from hp_doumi $s_que"));
// Á¤º¸¸¦ ±¸ÇØ¿È
$result=@mysql_query("select * from hp_doumi $s_que order by idx desc");
// ¾Õ¿¡ ºÙ´Â °¡»ó¹øÈ£
// $temp=mysql_fetch_array(mysql_query("select count(*) from hp_doumi $s_que"));
$number=$temp[0]
?>
<head>
<head>
<title><?=$g4[title]?></title>
<style type="text/css">
/* ¿¢¼¿ ´Ù¿î·Îµå·Î ÀúÀå½Ã ¼ýÀڷΠǥ½ÃµÉ °æ¿ì ¹æÁö */
.txt {mso-number-format:'\@'}
</style>
</head>
<body>
<table>
<tr>
<td>¹øÈ£</td>
<td>ºÀ»çÀÚ¸í</td>
<td>»ý³â¿ùÀÏ</td>
<td>¼ºº°</td>
<td>°áÈ¥¿©ºÎ</td>
<td>³ªÀÌ</td>
</tr>
<?
while($data = mysql_fetch_array($result)) {
$idx = $data[idx];
$d_name = $data[d_name];
$d_birth = $data[d_birth];
$d_birth_ = explode("-",$d_birth);
$d_birth1 = $d_birth_[0];
$d_birth2 = $d_birth_[1];
$d_birth3 = $d_birth_[2];
$d_sex = $data[d_sex];
if ($d_sex == 'M') { $d_sex = '³²'; }
if ($d_sex == 'F') { $d_sex = '¿©'; }
$d_marriage = $data[d_marriage];
if ($d_marriage == 'y') { $d_marriage = '±âÈ¥'; }
if ($d_marriage == 'n') { $d_marriage = '¹ÌÈ¥'; }
$d_age = $data[d_age];
?>
<tr>
<td class='txt'><?=$idx?></td>
<td class='txt'><?=$d_name?></td>
<td class='txt'><?=$d_birth?></td>
<td class='txt'><?=$d_sex?></td>
<td class='txt'><?=$d_marriage?></td>
<td class='txt'><?=$d_age?></td>
</tr>
<?
$number--;
}
?>
</table>
</body>
</html>
|
|
̵̧ : 232 |
̵̧
¸ñ·Ï
|
|
|  |
|