Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML PHP

Reply
Thread Tools

XML PHP

 
 
J Sharman
Guest
Posts: n/a
 
      11-13-2003
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


 
Reply With Quote
 
 
 
 
Alexander Schatten
Guest
Posts: n/a
 
      11-13-2003
On Thu, 13 Nov 2003 15:08:11 +0000, J Sharman wrote:
>
> 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?
>


I think you really should build a house by starting with the
foundation, not with the roof: I suggest, that you buy one of the dozens
of XML books, to get a better idea about XML.

then I suggest, that you look at standards like:

XSLT
XPATH
XQUERY
XMLB (e.g., Apache Xindice, eXist)


Alex
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
Best site for freelancer work (PHP, Web site, java, oracle sql, php,data entry) raviraj joshi NZ Computing 0 07-04-2009 03:05 PM
Learn how to edit php pages with free php editor torque63 HTML 0 01-01-2009 03:45 AM
RE: php and python: how to unpickle using PHP? Ted Zeng Python 0 10-13-2006 12:11 AM
php and python: how to unpickle using PHP? Ted Zeng Python 4 10-03-2006 03:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57