This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > September 2005 > Re: XML Crashes on ü ë é etc.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: XML Crashes on ü ë é etc.
Clee

2005-09-29, 6:26 pm

Here is the PHP code

<?php
header("Content-type: text/xml");
header("Encoding: utf-8");

//Developed by -==[Mihir Shah]==- during my Project work
//for the output



//to create connection to database
$connection = mysql_connect("localhost","username", "password")
or die ("could not connect to database");

//to select the database here test is the sample database come with mysql
$db = mysql_select_db("database",$connection)
or die ("Couldn't select database.");

$rs = mysql_query("select id, company, address, name, postalc, city,
country, code from docu_request where behandeld='0'",$connection)
or die ("invalid query");

//count the no. of columns in the table
$fcount = mysql_num_fields($rs);

//you can choose any name for the starting tag
echo ("<result>");
while($row = mysql_fetch_array( $rs ) )
{
echo ("<tablerow>");
for($i=0; $i< $fcount; $i++)
{
$tag = mysql_field_name( $rs, $i );
echo ("<$tag>".htmlspecialchars($row[$i]). "</$tag>");
}
echo ("</tablerow>");
}
echo ("</result>");
?>

"Joe Fawcett" wrote:

> "Clee" <Clee@discussions.microsoft.com> wrote in message
> news:33004892-DA52-4B1D-A0BB-007A336CCA79@microsoft.com...
> Well it sounds as if it isn't.
> Show us how you produce it.
>
> --
>
> Joe
>
>
>

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews