PHP, MySQL, XML: Where am I going?

rendezvouscp

macrumors 68000
Original poster
Aug 20, 2003
1,526
0
Long Beach, California
Hello all. I've been doing quite a bit of research about the three items listed above. I'm starting a new version of my website, and would like to have a database of information so that I can easily add (myself and comments for my blog), edit, remove, display, as well as search, my website.

No matter what I know that I'll be using PHP for most of the calls and such. However, I don't know what to do about the MySQL and XML bit. It seems like MySQL is being recommended because it is a relational database, and that's beautiful to me. However, XML seems easier to edit and I'm sure I can use calls such as XMLHttpRequest with an XML database (which I am set on using in my site).

So, where should I direct myself? Can I use XMLHttpRequest with MySQL (I feel stupid for asking that)? A combination of the two? What do you do for your website?
-Chase
 

Knox

Administrator
Staff member
Jul 1, 2002
1,267
1
UK
The normal way of doing it is that you'd use MySQL to store the data together with PHP to retrieve the data from MySQL and to format the data. How you format it is up to you, normally it would be HTML pages but you can also use PHP to create XML. That XML can then be loaded by the client using XMLhttprequest.

I wouldn't use XMLhttprequest as the sole method of generating pages. It would primarily be used for creating dynamic interfaces, for example, I'm working on a registration form that gives a visual indication of whether you've entered the right information (eg a valid email address) before you submit the page, however that is an optional feature and PHP will still process the data as normal.

I would concentrate on PHP & MySQL first, and use XMLhttprequest for selected interface improvements.
 

davecuse

macrumors 6502
Feb 20, 2004
419
0
NYC
Here is a link to a pretty good article concerning creating a personalized PHP and MySQL Content Management System.

http://www.intranetjournal.com/php-cms/

This seems like what you are trying to accomplish. You may also want to consider using an Open Source CMS, you may not learn quite as much in the process, but you'll most likely end up with a more stable end result and save yourself a boatload of time. The two systems I like are:

http://drupal.org/

http://mamboserver.com/

These two system already have syndication built in which create XML RSS feeds for your blog.
 

rendezvouscp

macrumors 68000
Original poster
Aug 20, 2003
1,526
0
Long Beach, California
Ah, I meant to say that I'm set on using XMLHttpRequest as a feature (for LiveSearch), not merely for generating pages.

I really am interested in learning the process, but would it be better to opt for an open source system instead? In my case, that I want to build something that allows input, viewing, editing, and searching, would it be safer to go with a third-party solution for ease and security reasons? Would I still be able to create my own PHP files and such to expand on the features as needed (such as expanding the search to include LiveSearch)?

Thanks, I'm already learning quite a bit.
-Chase
 

Knox

Administrator
Staff member
Jul 1, 2002
1,267
1
UK
rendezvouscp said:
Ah, I meant to say that I'm set on using XMLHttpRequest as a feature (for LiveSearch), not merely for generating pages.
Phew, you had me worried for a second :)

rendezvouscp said:
I really am interested in learning the process, but would it be better to opt for an open source system instead? In my case, that I want to build something that allows input, viewing, editing, and searching, would it be safer to go with a third-party solution for ease and security reasons? Would I still be able to create my own PHP files and such to expand on the features as needed (such as expanding the search to include LiveSearch)?
Using a pre-built system will certainly get the site up quicker and it would probably be better from a usability/security point of view, yes. However, if you want to learn the best way is to write sites, so it could be worth doing it yourself. It does sound like you're only wanting fairly simple things, so might be a good place to start.

You can add additional PHP code to an OSS, but one problem is that to do anything slightly unusual (and adding LiveSearch might count as unusual I think) you have to be able to understand the existing code. If you're not familiar with PHP it could be quite daunting.
 

jaseone

macrumors 65816
Nov 7, 2004
1,245
57
Houston, USA
rendezvouscp said:
Ah, I meant to say that I'm set on using XMLHttpRequest as a feature (for LiveSearch), not merely for generating pages.

I really am interested in learning the process, but would it be better to opt for an open source system instead? In my case, that I want to build something that allows input, viewing, editing, and searching, would it be safer to go with a third-party solution for ease and security reasons? Would I still be able to create my own PHP files and such to expand on the features as needed (such as expanding the search to include LiveSearch)?
You should be able to do that without too much trouble as all it really is accomplishing is to dynamically include the result of requesting a .php file into an existing page without refreshing, so you could modify the CMS or blog software's search results page functionality to return the HTML you want to include.

It is much easier learning something by only doing small things like modifying existing code, starting from scratch adds more frustation into the mix that gets in the way of learning a lot of the time so I recommend grabbing something existing and then modifying it to begin with then if you find it fundamentally doesn't meet your needs then you can roll your own.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.