php create xml file from mysql, Here I am giving you the very basic sample code for creating XML file through PHP and MYsql. We given code sample for this.
php create xml file from mysql
04 | header( 'Content-type: text/xml' ); |
09 | $connection = mysql_connect( "example.com" , "username" , "password" ) or die ( "Could not connect." ); |
12 | $query = "select * from " . $table_name ; |
14 | $result = mysql_query( $query , $connection ) or die ( "Could not complete database query" ); |
15 | $num = mysql_num_rows( $result ); |
17 | while ( $row = mysql_fetch_assoc( $result )) { |
18 | echo "" . $row [ 'firstname' ]. "" ; |
19 | echo "" . $row [ 'lastname' ]. "" ; |
24 | echo "" . $row [ 'age' ]. "" ; |
thanks this is very usefull.