Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2004, 07:46 AM
Authorized User
 
Join Date: Oct 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML, MYSQL ad PHP

I have been reading through the PHP books and for the most part the book was suggesting the use of XML MYSQL and PHP. But I couldn't understand why one would want to use XML. I was wondering if anyone could enlighten me a bit on the purpose of using XML PHP and MYSQL and how I should use them together.

<>_<>
__________________
<>_<>
 
Old October 27th, 2004, 08:26 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

That depends on what exactly you need to accomplish.

XML is a versitle language with endless possibilities. The most common I can think of is the RSS feeds you see posted to website blogs and news websites. This use allows a structured and standardized syndication of data. It can also be used to generate things like documentation. It can house and describe data similarly to what is possible with databases. XML files can be parsed and read into arrays or objects and at that point you have a pretty powerful templating system.

There's a lot of buzz surrounding SOAP in PHP, in which I've been told XML plays a large role, but I've yet to explore it myself. You can find out a little about what SOAP is from this Google link:
http://www.google.com/search?q=define:+SOAP


Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old October 27th, 2004, 08:39 AM
Authorized User
 
Join Date: Oct 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the input that helps abit. My response at this point is, my main purpose is web design and I built a lot of CMS systems. Would it be more efficient to use XML to handle data rather than MYSQL? I thought of creating a system that would create xml documents from a MYSQL database. What are your inputs on something like this?

<>_<>
 
Old October 27th, 2004, 09:53 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

That depends on the content that you're managing.

If you have a predefined set of criteria that each page must conform to, where no or few relational calculations are preformed between one XML document and another, then XML would be an ideal abstraction, and even more so if that data needs to be syndicated.

If on the other hand, you must preform lots of queries on that information and that information is needed to build calculations and relational data, then XML would be a slower and less efficient storage recepticle.

The example I like to give is that of a recipe. A recipe is a good candidate for XML. Even considering that you might use that recipe to calculate serving sizes, cost of preparation and/or labor. Generally speaking those are calculations that aren't typically made very often. XML is ideal because one recipe isn't typically related to another where building data is concerned. A DB is more appropriate if that data is relational.

The point I stress here is relational data belongs in a DB, which is why DB's exist in the first place!

That's my opinion anyway. I should also mention that I'm not the most affluent in XML, you might hear stronger arguments for what belongs in XML in the XML forums.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old October 27th, 2004, 10:27 AM
Authorized User
 
Join Date: Oct 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I will try there after this final question. My disire for using XML stems from the fact that I am usually working with servers where this is a potential for MYSQL db failure. I want to ensure the stability of the sites that I create. My plan is as follows:
  1. Create a MYSQL DB to house all data.
  2. Have a php script export data to xml.
  3. Have XML file be parsed for data interaction with site.

The data will be constant and will only be changed if the Database is changed. This way, if the database Goes down the site still functions. My only concern is speed. The site will pretty much be composed of pages with a news management script very basic data. It will have similaries to the site http://www.elijahrevolution.com which uses MYSQL db. Do you think this is a good suite for my idea?

<>_<>





Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL export XML using PHP lla Access 0 May 30th, 2008 11:11 AM
Add existing AD user to AD group via ADSI? thiazi Classic ASP Basics 0 August 24th, 2007 09:27 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
creating a xml ad file from a database source ACE2084 ASP.NET 1.0 and 1.1 Basics 4 January 21st, 2005 05:53 AM
PHP with Microsoft AD spraveens PHP How-To 1 April 30th, 2004 01:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.