J
J Sharman
I am fairly familiar with PHP and MYSQL and I know a little about XML.
I would like to know if it is possible to do queries on XML similar to the
way that you do queries on MYSQL and then use the results.
An example of a simple PHP/MYSQL setup.
<?php
$user="username";
$host="sqlserver";
$password="password";
$database="database";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to the server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't connect to the server");
$query = "SELECT * FROM database WHERE(Criteria)";
$result = mysql_query($query)
or die ("Couldn't execute query.");
while ($row = mysql_fetch_array($result))
{
extract($row);
echo"Set of instructions to carry out for each row in the
result";
}
?>
The question is, is it possible to do similar things with PHP/XML?
Lets say that I have an XML file located at a certain URL and I want to run
a query on it and use the results.
1. Is it possible?
2. What is the easiest way to do it?
3. How would I translate the above code to work with XML?
4. Is ther resource on the web on how to structure the queries?
Any help is much appreciated.
Rgds
Joe
I would like to know if it is possible to do queries on XML similar to the
way that you do queries on MYSQL and then use the results.
An example of a simple PHP/MYSQL setup.
<?php
$user="username";
$host="sqlserver";
$password="password";
$database="database";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to the server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't connect to the server");
$query = "SELECT * FROM database WHERE(Criteria)";
$result = mysql_query($query)
or die ("Couldn't execute query.");
while ($row = mysql_fetch_array($result))
{
extract($row);
echo"Set of instructions to carry out for each row in the
result";
}
?>
The question is, is it possible to do similar things with PHP/XML?
Lets say that I have an XML file located at a certain URL and I want to run
a query on it and use the results.
1. Is it possible?
2. What is the easiest way to do it?
3. How would I translate the above code to work with XML?
4. Is ther resource on the web on how to structure the queries?
Any help is much appreciated.
Rgds
Joe