|
 |
|
อยาก Export ข้อมุลจาก Mysql ครับ แต่มันพอ Export ออกมามันเป็นภาษาอะไรก็ไม่รู้ครับ |
|
 |
|
|
 |
 |
|
อยากจะ Export ข้อมูลจาก MySql ครับ โดยผมเขียน db จาก Appserv v.2.5.9 นะครับ
ผมสร้าง db จาก phpMyAdmin Database Manager Version 2.10.2
แต่พอจะ Export ออกมา มันกลายเป็นภาษาต่างดาวครับ
แต่ถ้าแสดงใน webpage โดยใช้ php ดึงออกมาดูได้นะครับ
แต่ความจำเป็นจริง ๆ ต้องการ Export เป็น Excel ครับ
code frmadd.php นะครับ
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Form SS new</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<script type="text/javascript" src="calendar.js"></script>
<style type="text/css">
<!--
.style1 {color: #0000FF}
-->
</style>
</head>
<body id="main_body" >
<img id="top" src="top.png" alt="">
<div id="form_container">
<h1><a>Untitled Form</a></h1>
<form action="frmsave1.php" name="frmAdd" method="post">
<div class="form_description">
<h2>แบบบันทึกข้อร้องเรียนประจำเดือน</h2>
<p>ฝ่ายวิเคราะห์และออกแบบระบบ</p>
</div>
<ul ><table width="699" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="46%"><ul >
<li id="li_1" name="li_1" >
<label class="description" for="element_1">วันที่รับเรื่อง </label>
<div>
<input id="element_1" name="date" class="element text meduim" type="text" />
</div>
</li>
</ul> </td>
<td width="54%"><ul >
<li id="li_2" >
<label class="description" for="element_2">รหัส </label>
<div>
<input id="element_2" name="code" class="element text meduim" type="text" />
</div>
</li>
</ul> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><ul >
<li class="buttons">
<div align="right">
<input type="hidden" name="form_id" value="80189" />
<input id="saveForm2" class="button_text" type="submit" name="submit" value="Submit"/>
</div>
</li>
</ul> </td>
<td><ul >
<li class="buttons">
<div align="left">
<input type="hidden" name="form_id" value="80189" />
<input id="saveForm" class="button_text" type="reset" name="reset" value="Reset" />
</div>
</li>
</ul> </td>
</tr>
</table>
</ul>
</form>
<div id="footer">sss</div>
<img id="bottom" src="bottom.png" alt="">
</body>
</html>
frmsave1.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Form SS new</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<script type="text/javascript" src="calendar.js"></script>
<style type="text/css">
<!--
.style1 {color: #0000FF}
-->
</style>
</head>
<body id="main_body" >
<img id="top" src="top.png" alt="">
<div id="form_container">
<h1><a>Untitled Form</a></h1>
<form id="form_80189" class="appnitro" method="post" action="frmsave.php">
<div class="form_description">
<h2>แบบแสดงความคิดเห็น</h2>
</div>
<ul ><table width="800" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="44%"> </td>
<td width="56%"> </td>
</tr>
<tr>
<td colspan="2"><div align="center">
<?
$link=mysql_connect("localhost","root","valen");
if (!$link)
{
print("ERROR Cannot conect Database.");
}
else
{
//ติดต่อฐานข้อมูล MySQL ชื่อ test
mysql_select_db("opinion",$link);
//เปิด ตารางชื่อ testcom และ เขตข้อมูล ชื่อ name,class,school,today,time,score
$sql="insert into opinion (date,code)
values ('$date','$code','$typed')";
//เพิ่มข้อมูลลง Database
$res = mysql_query( $sql , $link );
if ($res==1)
print("Save Done. OK");
else
print("Error. ");
}
//เปิดดูข้อมูล
print "<br><a href=list.php>เปิดดูข้อมูล</a>";
?>
</body>
</html>
</div></td>
</tr>
</table>
</ul>
</form>
<div id="footer">sss</div>
<img id="bottom" src="bottom.png" alt="">
แต่พอ Export เป็น Excel เป็นงี้ครับ
date code typed
เธซเธ”เธซเ เธเธซเธเ 3.เธชเธดเธ—เธเธดเธเธนเนเธเนเธงเธข
เธเธเธซเ เธเธซเธเ 2.เธเธฒเธฃเธเธฃเธดเธเธฒเธฃ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-07-29 15:59:07 |
By :
tongmew02 |
View :
1391 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 04
|