![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. Is there some recommended structure or something? |
|
tnx |
#3
| |||
| |||
|
|
croora schreef: I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. Is there some recommended structure or something? Well, common sense? Define all the elements (attributes) you want to store. Create a table that holds that information. Use a serial (autonumber) primary key in that same table to identify each record. Regards, Erwin Moller tnx |

#4
| |||
| |||
|
|
Erwin Moller wrote: croora schreef: I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. Is there some recommended structure or something? Well, common sense? Define all the elements (attributes) you want to store. Create a table that holds that information. Use a serial (autonumber) primary key in that same table to identify each record. Regards, Erwin Moller tnx i know that it looks simple, but it isn't ![]() in RSS specification, some tags has own attributes and another nested tags (etc. <enclosure> has attributes, <image> has 3 nested elements). |
#5
| |||
| |||
|
|
On 2009-04-14, croora <croora (AT) net (DOT) hr> wrote: Erwin Moller wrote: croora schreef: I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. Is there some recommended structure or something? Well, common sense? Define all the elements (attributes) you want to store. Create a table that holds that information. Use a serial (autonumber) primary key in that same table to identify each record. Regards, Erwin Moller tnx i know that it looks simple, but it isn't ![]() in RSS specification, some tags has own attributes and another nested tags (etc. <enclosure> has attributes, <image> has 3 nested elements). xml does not translate well to a relational database. you might try something liek this. CREATE TABLE xmlnode ( id serial PRIMARY KEY, nodename TEXT, parentnode integer references xmlnode(id) ON DELETE CASCADE, textvalue TEXT ) CREATE TABLE xmlattribute { node integer REFERENCES node(id) ON DELETE CASCADE, attrnum INTGER, attributename TEXT, atrtribute TEXT, PRIMARY KEY (node,attrnum) } but I can't see it being very useful. why do you wish to represent the XML as relations, what sort of manipulations do you plan to do on it using SQL? I would be inclined to put entire articles into TEXT fields, |

#6
| |||
| |||
|
|
Jasen Betts wrote: On 2009-04-14, croora <croora (AT) net (DOT) hr> wrote: Erwin Moller wrote: croora schreef: I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. why do you wish to represent the XML as relations, what sort of manipulations do you plan to do on it using SQL? I would be inclined to put entire articles into TEXT fields, i try to store misc RSS feeds in database, manipulate them and then restore RSS again (mysql+php). does have sence doing something like that? or it is waist of time? i don't know, maybe i return to one TEXT field and XML parser ![]() tnx on any advice |
#7
| |||
| |||
|
|
On 2009-04-14, croora <croora (AT) net (DOT) hr> wrote: Jasen Betts wrote: On 2009-04-14, croora <croora (AT) net (DOT) hr> wrote: Erwin Moller wrote: croora schreef: I like to store all RSS 2.0 elements in db with php. I try to design optimal database structure. why do you wish to represent the XML as relations, what sort of manipulations do you plan to do on it using SQL? I would be inclined to put entire articles into TEXT fields, i try to store misc RSS feeds in database, manipulate them and then restore RSS again (mysql+php). does have sence doing something like that? or it is waist of time? i don't know, maybe i return to one TEXT field and XML parser ![]() tnx on any advice unless there's functionality to be gained by breaking int into pieces in the database (I can't see there being a performance gain) just keep it as large chunks of XML in text fields and use a parser. |

![]() |
| Thread Tools | |
| Display Modes | |
| |