[wp-hackers] The WordPress schema

Blast o_O neryver at infomed.sld.cu
Mon Nov 5 13:16:50 GMT 2007


Heyy, I like the way you talk in this list people :)

Travis, please look at my comments below ;)

On Sun, 2007-11-04 at 20:05 -0800, Travis Snoozy wrote:
> On Sun, 04 Nov 2007 16:06:01 -0500, Blast o_O <neryver at infomed.sld.cu>
> wrote:
> 
> > Thanks to all answers ;)
> > 
> > Do you know where can I find a picture about the schema!!!??? :)
> > I'm tryin to install DBDesigner in my Ubuntu but I have lots of
> > troubles reading MySQL servers ;)
> > 
> > Thanks to all ;)
> > B.
> > 

> If you're writing a plugin, you really, really, really should try to
> avoid messing with the WordPress-stored data by hand (which is the only
> reason you would need to know about the schema).

With a friend are studying different databases schema like mediawiki,
pligg and others and we wanted to print the one from wordpress too, so
there is another reason ;) and that's why I asked if there where a
generated picture from the database, as the one I found from the
mediawiki for instance ;) [b1]

> Use the WordPress
> APIs[1][2] to alter and read what you need about users, posts,
> tags/categories, links, comments and options. This will make your code
> more robust if the schema changes in the future.

Thanks for the info, i haven't even thought in the wordpress api ;)

> If you absolutely must query the tables directly, the easiest way to
> see how they work is to either view the schema file[3], or install
> Apache, PHP, MySQL and WordPress on your local box, and look at the
> database WordPress creates. The MySQL manual[4] should have all the
> information you need about SQL syntax and the DESCRIBE TABLE
> and SELECT commands. No, it won't describe the relationships for you --
> you have to match the foreign keys up yourself, since the FK constraints
> are not explicitly set in this schema (which means you also won't be
> able to "get a picture" -- the connections will be missing). It's not
> hard to figure out what the fields do, and which fields are foreign key
> references, just from the field names. It's what developers like to call
> "self-documenting". ;)
> 
> Again, it's not too hard -- however, it does provide a bar, whether
> intentional or not. You have to grok RDBMSs and English

About my "groking" and my English, well, I'm trying :) but thanks
anyway!!!

> at at least a
> minimal level, and have a little bit of developer's intuition, before
> you can start playing with these matches.
> 
o_O
> 
> As to your other question: you cannot get the schema for a site's
> database (e.g., "craigslist"), unless you have access to the back-end
> SQL servers or a person with inside knowledge -- that information is
> private. In any case, unless you're running software *on* that site,
> the scheme it uses is completely irrelevant. There is no such thing as
> a "site schema".

I know it may be hard to find out the db schema of a site but there
should be somewhere in the net info about cragislist and the way the
organize their info, and the way the have structured their site, as you
said I have to improve my English!

See ya!!
B.

[b1] http://www.mediawiki.org/wiki/Image:Mediawiki-database-schema.png




More information about the wp-hackers mailing list