Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Easy to use Database function

 [1/2] from: etcha::gsat::net::au at: 26-Jul-2000 17:42


This is a multi-part message in MIME format. ------=_NextPart_000_0036_01BFF728.ED42E540 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am building a web application server with rebol, and have had no reall problems up until now, that i want to implement a function I call pageid .... that is , a form can have a page id which is like A23-C0399 , the page id i then want to be the reference value , and i want to use a database type system to store the values. , is there a good function that anyone has written that allows easy adding, removal, modfication and retrieval of data from a rebol type db . this would be handy in the fact that i could - use a form with a pageid to add a pageid - use the function to easily add it to the database - use the database to update the list page - use the database to retreive if a pageid is present and if so retrive the pageid's details. the information the db needs to hold should be anything, especially one line sentences and strings. any help would be muchly appreciated, aden ------=_NextPart_000_0036_01BFF728.ED42E540 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type> <META content="MSHTML 5.00.2722.2800" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#d0d4e0> <DIV>&nbsp;</DIV> <DIV><FONT size=2>I am building a web application server with rebol, and have had no reall problems up until </FONT></DIV> <DIV><FONT size=2>now, that i want to implement a function I call pageid&nbsp;&nbsp;&nbsp; .... that is , a form can have a page id</FONT></DIV> <DIV><FONT size=2>which is like A23-C0399 , the page id i then want to be the reference value , and i want to </FONT></DIV> <DIV><FONT size=2>use a database type system to store the values. , is there a good function that anyone has written</FONT></DIV> <DIV><FONT size=2>that allows easy adding, removal, modfication and retrieval of data from a rebol type db .</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=2>this would be handy in the fact that i could </FONT></DIV> <DIV><FONT size=2></FONT>&nbsp;</DIV> <DIV><FONT size=2>- use&nbsp;a&nbsp;form with a pageid to add a pageid</FONT></DIV> <DIV><FONT size=2>- use the function to easily add it to the database</FONT></DIV> <DIV><FONT size=2>- use the database to update the list page</FONT></DIV> <DIV><FONT size=2>- use the database to&nbsp;retreive if a pageid is present and if so retrive the pageid's details.</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=2>the information the db needs to hold should be anything, especially one line sentences and </FONT></DIV> <DIV><FONT size=2>strings.</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=2>any help would be muchly appreciated,</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT size=2>aden</FONT></DIV> <DIV>&nbsp;</DIV> <DIV>&nbsp;</DIV> <DIV>&nbsp;</DIV> <DIV>&nbsp;</DIV></BODY></HTML> ------=_NextPart_000_0036_01BFF728.ED42E540--

 [2/2] from: norsepower:uswest at: 26-Jul-2000 9:04


I use a system which may not be the best solution but it works in my head space. On my news Web site, the common denominator is the news article, including the headline, byline, body copy, etc. This then is the basic value to be stored. Each news article is saved in a text file as an object expression so that the values can be loaded and objects can be created on the fly. Each object expression has a "reference-id" which matches the name of the file. The reference-id is based on the time the file was created in digits (e.g. 200007251762). Since file creation is automated, this assures there will never be a file or object of the same name (wait 1 is used to keep it incremental.) Articles can be commented on. Comments are saved in the same fashion, with their own reference-ids which match the name of the file containing the comments in an object expression. The comments relate to a specific article by being saved in a directory with the same name as the article that the comments reference. Of course, the comments directories are saved in an alternate directory separate from the path where the articles are saved. This creates a database using the file system, directories and files as the cells where data is stored. Like I said, I don't know if it is the best solution, but since data is kept in separate files, individual articles can be deleted from the "database" quite easily and there is no single, large file that must be loaded into memory each time the database is accessed. Data is sought out by simply reading a directory and looking for a reference ID. -Ryan