How can I integrate this simple database into my website?
May 22, 2006 8:32 AM   Subscribe

I'm working on a website for my band, and I would like to have a section on the main page which lists news items. I don't want to have to edit the html file every time I want to add an update though. I'd like it to run from a database or something, so can I set something up to display the 5 most recent database entries on my website?

Someone suggested that I use MySQL to accomplish this. I know nothing about MySQL and how to intigrate it into a website. Anyone got any advice?
posted by bajema to Technology (10 answers total) 2 users marked this as a favorite
You could just use blogging software and set it to display 5 posts. Check out Worpress or MovableType.
posted by afx237vi at 8:34 AM on May 22, 2006

If you're using PHP and your data is in MySQL, here is a script to take MySQL data and publish it to a RSS 2.0 feed (via rcade).

Now that your news articles are coming from a RSS feed, you can embed a specific number of new articles (e.g., the last five items) into your main page using Magpie.
posted by Mr. Six at 8:42 AM on May 22, 2006

Skallas, has it nailed. Editing an html page is dead easy, setting up a database is much harder.
Make the section your want to display the news in an iframe, make the source page for the iframe a table or a stack of divs. Then the target page that you have to edit is as simple as possible.
posted by doctor_negative at 8:50 AM on May 22, 2006

Wordpress, wordpress, wordpress.

Dead simple to install, does all the story juggling for you, looks nice.

All you do is enter content.
posted by unixrat at 8:55 AM on May 22, 2006

To nicely intergrate news items into an existing website design, you could use a blogging tool which can publish to an RSS feed like, and an RSS aggregator for whatever server side scripting you are using like magpieRSS for PHP. The latter will allow you to pull your RSS feed into your exising site and format it as you like.

Either that or just use the template system with the likes of, depending on how server side scripting savvy you are.
posted by superfurry at 9:51 AM on May 22, 2006

Response by poster: I had not thought about pulling the info from an RSS feed. I'm going to take a look at magpieRSS.
posted by bajema at 9:58 AM on May 22, 2006

I'd second all the recommendations for blogging software, with the caveat that you'd probably want to choose one that's hosted or preinstalled -- that way you're not having to fix or upgrade software or deal with troubleshooting something when you just want to post an update about a gig.

I'd recommend TypePad, which lets you totally customize your HTML if you want, but generally bundles everything together into one service. (Basic statistics, photo albums so you can display pictures from a show, the ability to post audio as a podcast.) Caveat: I work for the company that makes TypePad, but it's what I'd use for this kind of thing regardless.
posted by anildash at 10:05 AM on May 22, 2006

Ditto the blog suggestion. You could also do this using Movable Type (which is also published by anildash's company, and with which I am more familiar) or blogger.

You could design the blog template to look exactly like your existing pages, and just use that as your front page, or you could design it to be a stub file (that is, just the news section, none of the surrounding static stuff, file headers, etc) that gets included on the fly into a static page. Either one would work (look up "server side includes" or "php includes" for more info).

Doing this by parsing RSS is more trouble than its worth, IMO. And the suggestion that you'd "use MySQL" is accurate but unhelpful--if someone says "I want to learn how to drive," you don't answer "use gasoline."

For a little more work, you could reproduce the whole site in blog/cms software, which would have benefits of easier management down the road, but would take more of an investment of time upfront.
posted by adamrice at 11:18 AM on May 22, 2006

Another thought, perhaps a compromise between the blog & the MySQL route -- if you're willing to learn a little php, you could write a script that reads the news items from a text file (that contains no html, just the items). The formatting could be accomplished either via the php script or CSS. This way you get dynamic content (just update the text file with new items) without the database headaches.
posted by treepour at 1:01 PM on May 22, 2006

I run a band site and I use HostBaby hosting, which is designed for musicians. It has a built-in mailing list, show calendar, & news/blog page. It also makes streaming music really easy, though I don't use it -- streaming music bad -- so I can't say how well it works, but the other built-in stuff, while less shiny than Blogger, etc., is pretty easy to use. Plus, it's all in one package.

I could've done it all myself, but even at $20/month (which I find slightly expensive for hosting), it's cheaper than my time.

The customer service is pretty good, and if you're at least somewhat familiar with HTML & PHP, you can get a lot of your questions answered on their forum.
posted by librarina at 9:54 PM on May 22, 2006

« Older Good webhost?   |   Literal "debugging" issues. Newer »
This thread is closed to new comments.