0

I have just started using XML as I usually use php but I am trying to create a RSS feed so it is necesary. What is the best way of getting the data from my mysql database which I use with php that stores my blog? Is there anyway of using php inside of a XML document or would I have to do it using XML?

1
  • 1
    It sounds like you're reacting to a buzzword. XML, PHP and MySQL are orthogonal. Commented Mar 5, 2011 at 17:28

1 Answer 1

2

You are confused. XML is a format to store data, like .doc, .txt or .bmp (for image data).

If you want to get data from MySQL and put it in XML, you'll need a program that will do this for you.

You can use PHP to read the data from MySQL, and output it as XML or RSS.

Sign up to request clarification or add additional context in comments.

6 Comments

I see, is there a tutorial on how to do this? I must have got confused because you use tags in it like html.
If you are working with a Linux server, you can always use @konerak answer to create a php script to pull the data from the MySQL database and output it to XML/RSS. After you have created the script you can configure a cron job to run the script every so often (like once an hour or whatever) to pull new MySQL data. 0 */1 * * * root php /scripts/update_RSS.php
so I can set a rss feed as a php file?
@Yesterday: You don't do this in HTML any more than in XML! You've made the mistake of thinking that PHP goes "in" HTML, whereas in fact PHP is often seen outputting HTML.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.