php and xml
Hi there I need to design a web page that will take some attributes
from an xml data file and load its content into a database
I have a personal web server running mysql and php 4.3 and i can
design web pages etc.
What sort of script would enable me to do this? Obviously I would
need to access the database using INSERT commands of sql but how do
i get php to access the xml file and retreive the data I need?
could anyone set me off or perhaps recommend a tutorial or two?
Re: php and xml
paranoid-android wrote:
> What sort of script would enable me to do this? Obviously I would
> need to access the database using INSERT commands of sql but how do
> i get php to access the xml file and retreive the data I need?
>
http://www.php.net/simplexml
http://www.php.net/dom
http://www.php.net/xsl
http://www.php.net/xml
JW
Re: php and xml
thank you very much for your help.
Re: php and xml
Hi
Use simplexml.. It works pretty well.......
Here is some sample code to return specific values in the xml file.....
$file = "http://domain.com/skillset.xml";
$xml = simplexml_load_file($file);
//Prints the values based on array value
print "<br>SkillsetName:
".$xml->SkillsetStatistics->SkillsetStats[5]->Skillsetname;
print "<br>Calls Offered
".$xml->SkillsetStatistics->SkillsetStats[5]->CallsOffered;
print "<br>Calls Answered
".$xml->SkillsetStatistics->SkillsetStats[5]->CallsAnswered;
print "<br>Calls Abandoned
".$xml->SkillsetStatistics->SkillsetStats[5]->SkillsetAbando ned;
print"<br><br>";
Hope this helps
"paranoid-android" <paranoid-android [at] ntlworld.com> wrote in message
news:C4SAd.127$z11.83 [at] newsfe6-win.ntli.net...
> Hi there I need to design a web page that will take some attributes
> from an xml data file and load its content into a database
>
> I have a personal web server running mysql and php 4.3 and i can
> design web pages etc.
>
> What sort of script would enable me to do this? Obviously I would
> need to access the database using INSERT commands of sql but how do
> i get php to access the xml file and retreive the data I need?
>
> could anyone set me off or perhaps recommend a tutorial or two?