WordPress vs. HomeMade PHP Website

This post was written by tiw on January 26, 2009
Posted Under: Database Design, Links, PHP, Plugin, Programming

After my graduation in 2005, I started drawing some cartoons -which is nowhere near my favorite cartoon series “Fox Trot” or anything like that..- It was just for fun, spending some time while learning some tools.. Anyway, I also wanted to display these cartoons on the internet. But I didn’t have a WordPress account back then, or didn’t know about it yet.. So I decided to make my own PHP website in order to display the cartoons dynamically.

Here is the design I made for the database:

2 tables only. Nothing fancy :-)
One for the images “TBLIMAGE”, and the other for the subjects “TBLSUBJECT”.

Image table has the columns below:

  • imageID: unique id
  • fileName: name of the file that we will show
  • subjectID (key for getting the subject name from the subjects table)
  • filePreTxt: Some text to display just before the image
  • filePostTxt: Some text to display just after the image
  • strImageQueue: Within the subject every image has a queue which shows their priority to be shown
TBLIMAGE

TBLIMAGE

Subject table has the columns below:

  • parentSubjectID
  • subjectText: The title of the cartoon will use what ever text is in here
  • strSubjectDate: We will order the cartoon files first according to their subject dates
TBLSUBJECT

TBLSUBJECT

And here are some parts of the PHP codes, that you may find useful:

Setting up the configuration file by assigning the dbname, username, password values to their variables respectively:

$dbhost = 'localhost';
$dbuser = 'yourdbusername';
$dbpass = 'yourdbpassword';
$dbname = 'yourdbname';

Opening the database connection to work with:

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);

And finally, defining and running my query:

$query = "SELECT filepretxt, fileposttxt, filename, subjecttext, strimagequeue FROM tblimage, tblsubject  WHERE subjectid = parentsubjectid order by strsubjectdate asc, strimagequeue asc";
$result = mysql_query($query) or die('Error, query failed');

Well, I didn’t forget to close the database connection of course.

mysql_close($conn);

So, here is my question:
Now that we have a chance to use a powerful and easy to integrate web application like Wordpress, would you rather use it, or make your own PHP Website for displaying your works/cartoons/etc.?
Or lets put it this way:
Which one is better?
Whibdatt [WordPress] or Whibdatt [HomeMade]?

Special thanks to W3Schools for their nice and explanatory web development tutorials ^^

Share this:
  • email
  • Print
  • Twitter
  • Google Bookmarks
  • Reddit
  • del.icio.us
  • Digg
  • DZone
  • Technorati
  • Facebook
If you enjoyed this post, make sure you subscribe to my RSS feed!

Reader Comments

wordpress of course :)

#1 
Written By altuure on January 27th, 2009 @ 11:59 am

Well, I also think that WordPress is powerful, but say you want to make your web site multi language; you would either need to modify your WordPress a lot or install different instances for each language and give deep links from each post to the translated version respectfully.. Anyway, my web site is not so compicated yet :)

#2 
Written By tiw on January 29th, 2009 @ 7:52 am

Add a Comment

required, use real name
required, will not be published
optional, your blog address