ผมอยากทราบว่า การ Export php ออกมาเป็น xml
ทำได้หรือป่าว แล้วทำยังไงหรอ ใครรุ้ช่วยบอกโค๊ดหน่อยสิ
Tag : - - - -
Date :
11 ก.ค. 2551 10:07:06
By :
jood
View :
2688
Reply :
2
No. 1
Guest
<?php
// database constants
// make sure the information is correct
define("DB_SERVER", "localhost");
define("DB_USER", "root");
define("DB_PASS", "password");
define("DB_NAME", "tutorials");
// connection to the database
$dbhandle = mysql_connect(DB_SERVER, DB_USER, DB_PASS)
or die("Unable to connect to MySQL");
// select a database to work with
$selected = mysql_select_db(DB_NAME, $dbhandle)
or die("Could not select examples");
// return all available tables
$result_tbl = mysql_query( "SHOW TABLES FROM ".DB_NAME, $dbhandle );
// iterate over each table and return the fields for each table
foreach ( $tables as $table ) {
$output .= "<table name=\"$table\">";
$result_fld = mysql_query( "SHOW FIELDS FROM ".$table, $dbhandle );