[Web4lib] incorporating a table complete with HTML tags into a web enabled database

Walker, David dwalker at calstate.edu
Wed Mar 11 10:58:18 EDT 2009


+1 for saving it as XML.

MySQL 5.1 and some other databases give you the ability to use SQL/XPath queries if you ever needed to search across that data.

--Dave

==================
David Walker
Library Web Services Manager
California State University
http://xerxes.calstate.edu
________________________________________
From: web4lib-bounces at webjunction.org [web4lib-bounces at webjunction.org] On Behalf Of Tim Spalding [tim at librarything.com]
Sent: Wednesday, March 11, 2009 7:33 AM
To: John Fitzgibbon
Cc: web4lib at webjunction.org
Subject: Re: [Web4lib] incorporating a table complete with HTML tags into a     web enabled database

Some options.

1. Don't feel too guilty about tables. This website has it best:
http://giveupandusetables.com/ :)
2. A better solution would be to store it as a blob of XML, or XHTML
3. You might also consider making an appropriate data structure (eg.,
a multidimensional array) and then serializing it, using something
like PHP's serialize() command, or by encoding it as JSON.
4. You could probably make a db structure for storing arbitrary-size
tables. That would be ideal if you were going to search, sort or group
by the data. Otherwise, I think I'd skip it.

Tim

> The best I can come up with is to put the table in an additional field complete with HTML tags and table contents. I use an HTMLEncode function on the other fields when I output them to HTML. Obviously, I would have to avoid doing this with this particular field but that would not be a problem.
>
> This approach seems to be such a terrible kludge that I can't help thinking that there must be a more elegant solution.


_______________________________________________
Web4lib mailing list
Web4lib at webjunction.org
http://lists.webjunction.org/web4lib/



More information about the Web4lib mailing list