Making a mini blog program helping me understand Wordpress : the tables of its MySQL database
Recently, I've been making a mini blog program with PHP and MySQL.
This coming November, I plan to participate in a web creating competition.
According to a requisition made public in advance, I'm supposed to make a function of posting a comment.
To implement this function, I'm thinking that being familiar with PHP and MySQL is very important as well as making static web pages.
I began with a database with a quite simple table to manage posts with 4 columns, whose fields were, entry_id, entry_title, entry_body, entry_date.
I struggled with registering posts and displaying posts, and finally I succeeded to display posts.
Next, I desired to add a function to attach comments to a post.
Although I haven't implemented actual comment function, I made a table for comments.
This table required unexpectedly many fields.
In addition to the title, the content, and the date of a comment, it should have columns the name (and contact information) of who posts the comment. More important it should have the column to keep the id of the post the comment refers to. Relational concept is required, unlike simply registering and posting texts didn't specially require relational concept.
This motivated me to learn a little more about a typical blog application like Wordpress and its database.
I saw the Japanese version of Database Description in codex.wordpress.org.
Seeing the table of wp_posts, although there are a lot more fields to manage blog posts better, I saw that my approach wasn't so bad because it included the fields, id, post_content, post_title, post_date.
My mini blog may be really a humble one, but without it I would never understand even one table of the database. In this respect, making a humble mini blog program myself was a great progress to me.
This coming November, I plan to participate in a web creating competition.
According to a requisition made public in advance, I'm supposed to make a function of posting a comment.
To implement this function, I'm thinking that being familiar with PHP and MySQL is very important as well as making static web pages.
I began with a database with a quite simple table to manage posts with 4 columns, whose fields were, entry_id, entry_title, entry_body, entry_date.
I struggled with registering posts and displaying posts, and finally I succeeded to display posts.
Next, I desired to add a function to attach comments to a post.
Although I haven't implemented actual comment function, I made a table for comments.
This table required unexpectedly many fields.
In addition to the title, the content, and the date of a comment, it should have columns the name (and contact information) of who posts the comment. More important it should have the column to keep the id of the post the comment refers to. Relational concept is required, unlike simply registering and posting texts didn't specially require relational concept.
This motivated me to learn a little more about a typical blog application like Wordpress and its database.
I saw the Japanese version of Database Description in codex.wordpress.org.
Seeing the table of wp_posts, although there are a lot more fields to manage blog posts better, I saw that my approach wasn't so bad because it included the fields, id, post_content, post_title, post_date.
My mini blog may be really a humble one, but without it I would never understand even one table of the database. In this respect, making a humble mini blog program myself was a great progress to me.
Comments
Post a Comment