Link to home
Start Free TrialLog in
Avatar of imawake
imawake

asked on

Retrieve data from database file using id, output, serve up XML to html pages

Hi everyone,

I have 3 html pages and I would like specific content on each page to be dynamic. I would like the header text, featured image, and body text to be served up dynamically from a SQL database or Excel file.

The idea is to serve up specific headlines with corresponding images using their IDs pulled from the database/table file.

id 1 Whatever headline a    
id 2 Whatever headline b
id 3 Whatever headline c

and match it up with the featured images and body content:

id img1 Image of a cow
id img2 Image of a horse
id img3 Image of a goat

id body1 lorem ipsum blah blah content block
id body2 lorem ipsum blah blah block of text
id body3 lorem ipsum block of content

I would like to serve this data up via an xml file but I'm not sure how to do it and I need it done fast.

In basic terms, XML file should go something like this:

If display id 1 Whatever headline a
then display id img2 image of a horse
and id body3 lorem ipsum block of content

And serve up the matching content to the html pages with an XML string or something.

Will the code be simple to understand and implement? If possible, please give an example that I can test on my server in order to understand how to do it.

I don't know. Obviously I need help, I'm not a programmer. I need to understand how to do this but it needs to be done asap so this is a call for help. Your input is very appreciated!

Thank you!
Avatar of imawake
imawake

ASKER

Can anybody offer any ideas?

Thank you!
Avatar of imawake

ASKER

Alternatively, this data could be in the XML file and served client-side to the html pages with javascript or something. Please let me know if you can offer help in one or both methods.

Thanks!
Avatar of twohawks
Hi iamawake, Well, since no one is daring, I will take the risk...  but I cannot provide you an "answer"...

Just so you know, the reason I did not speak up to begin with is this seems to me like either you are taking a test and want the answer, or you do not know how to conduct the most fundamental search on the internet for something very basic - and yet you want information about how to do something that is going to take you some bit of time (something you say you do not even have) to actually learn about before you can begin to tackle the problem on your own...
-- which is way beyond the scope of something like posting a question in a forum like EE,
....and personally, I do not want to become burdened portending to offer help under these conditions.

I do not mean to posture condescendingly.  I am just calling it how I see it.

That said, since you are persisting, here is what I would say to your question...

1) The very first thing anyone is going to ask is why do you want to use xml?  
The problem with even asking is you have made it clear you do not have a clue about the scope of the problem you wish to address, so I don't really want to bother answering...

2) So this brings us to asking you... have you even tried to search the internet at all??
The problem with that question is I don't think we'd see a question posed in this way if you had, so again, don't bother answering that one either....

But hey, I could be wrong...

All right, I will quit busting your nuts now and offer this...

#1 In your favorite internet search engine conduct the following searches...

simple mysql php

sql php xml

simple mysql php xml

simple html xml

On the first search I found what appears to be a great tutorial to get you started understanding the nuts and bolts of how you could create and use a simple mysql database and use php to accomplish  everything you want.  It appears like a great beginning.
http://www.freewebmasterhelp.com/tutorials/phpmysql

...I only glanced at it so I cannot ultimately vouch.. you are going to have to do some reading up with other results that catch your eye.  


If you want to do xml you will find there some great tools out there for putting together a package, and some great guides.  
I found this intersting...  http://www.ibm.com/developerworks/library/x-query2xml/
Probably not what you are looking for however.

------------------------
The bottomline is, no one can simply tell you "how to" do it from scratch without you have time to take steps in learning about these tools.  However, you say you do not have time (to learn).


Either you gotta learn it, or you are going to have to hire someone to simply do it for you.

Good luck on your journey.

Avatar of imawake

ASKER

Thanks for the reply. I understand that what I'm asking is quite in depth and I don't mean to be asking for a perfect answer or for you to do it for me. I did look up several options specifically about client-side xml and javascript and I have knowledge of using xml with flash, but this is the first time I've attempted something like this. I'll see what I can come up with in the meantime and if I can figure out a simpe solution using javascript, xml and an access db, I should be fine.

If anyone would like to offer further input, it would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of twohawks
twohawks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of imawake

ASKER

Ok, thank you. This does help.
You are most welcome, iamawake.

I am surprised you closed the question so soon.  Perhaps some others may have chimed in over the course of a couple days.

Anyway, thank you for the points assignment.  I hope you sort out a viable solution without too much trouble.

There is another option that I did not mention... Content Management System Software, or using a "CMS".
A CMS software package is like a custom development kit for dynamic site building.  
Some examples are the popular wordpress, drupal, joomla, etc...

There are CMS packages taylored for just about any coding focus you can think of.
For instance, there are xml-based cms for developers (see links below ;^)

If you are unfamiliar with CMS systems, throw your searchbar at that for a spell.


Lastly, Here are a couple other tidbits for your journey ;^)
-------------------
Build an XML-Based Content Management System with PHP (2003 - old but still handy ;^)
http://www.sitepoint.com/management-system-php/

The related discussion thread to that article
http://www.sitepoint.com/forums/showthread.php?117493-Build-an-XML-Based-Content-Management-System-with-PHP

--------------------
*A list of XML based CMS for Web Developers   ;^)
http://www.tutorialfeed.org/2009/08/list-of-xml-based-cms-for-web.html    (2009)
http://gurushala.net/xml-based-cms-for-web-developers/      (2010)

--------------------
Good Luck!