 |
|
<?
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename="testing.csv"');
$host="localhost";
$username="root";
$password="1234";
$db="question";
$tb1="person";
$tb2="service";
$tb3="detail";
$tb4="suggestion";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
echo "44444,คำถาม,ตัวเลือกที่ 1,ตัวเลือกที่ 2,ตัวเลือกที่ 3,ตัวเลือกที่ 4,ตัวเลือกที่ถูก,\n";
$sql = "select * from $tb1";
$dbquery = mysql_query($sql);
$num_rows = mysql_num_rows($dbquery);
$i=0;
while ($i < $num_rows)
{
$result= mysql_fetch_array($dbquery);
echo "$result[id_detail],$result[id_project],$result[r3_1_1],$result[r3_1_2],$result[r3_1_3],$result[r3_1_4],$result[r3_1_5],\n";
$i++;
}
?>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-05-29 10:53:45 |
By :
nuttawut49172185 |
View :
1751 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |