<<previous page 1 2 3 4 5 6 7 8 9 next page>>
Database Schema
time: 2007-01-10 11:24:43
music: Spirit Thing
book: where wizards stay up late

So I thought this would be a good time to explain the back end of the website. Not the php side, but the sql. Since you can't get a computer science degree without being inundated with databases, I tacked this problem like we did at A&M. I first started off with a rough ER Diagram.

If you've never heard of an ER Diagram, it's basically just something that shows you have information is connected. In the past, databases were hierarchtical. Now that we use relations, we have to show what data goes where and how it is all inner connected.

The rough relationship diagramAs you can see from the diagram, this went through much work lol. I setup all the tables I thought I would need. The two tables in the center are simply there to show how posts relate to the tags and comments. I later completely removed HasComments because there was no need for it (since a comment can only be applied to one post, that information can be stored in the comment entry without any problem).
Tags had the most work done to it (why it took so long to implement). It originally had only three fields (ID, Name, Desc). After some thought, I removed ID since the name of the tag should be unique. Sadly, doing comparisons with a user defined tag name proved to be very difficult so I placed ID back in. Desc was the field for description. LOL, I felt so stupid when I did my first few queries and got SQL syntax errors. If you don't have much knowledge of SQL, DESC is a reserved word for sorting (you can sort in descending order). So I renamed it to Details. I also added NumOfPosts to the tags. This is just to keep from having to pull all the tag's posts every time it's displayed.

Getting the tag information for a post, or the posts that the tag relates to was fun to write. It's a two stage query:

SQL: getTaggedPosts
     select *
     from Posts WHERE ID IN(
     select PostID AS ID
     from IsTagged WHERE
     TagID = 'TagID#')
     ORDER BY ID DESC

As you can see, I first make a query of all the PostID's from the IsTagged table, then select from the Posts table the IDs that match. I saw online someone complaining about subqueries not working for him (actually, he was complaining about a logical error in mySQL). His problem was that the IN clauses didn't match. But, you can see that with AS, you can make a field with a different name and get the query to execute properly.

I guess that's pretty much all for now, maybe I'll make my first tutorial on how to setup a database with MySQL and php... nah! ;-)


Tags: WAD(5) FollowerofJC.com(10)
Myspace Plundered
time: 2007-01-10 10:12:39
music: Entertaining Angels
book: where wizards stay up late

This is just a quick little rant.

My friends and I have been noticing that myspace is getting more and more cramped with... junk. lol this came very apparent when I got an email today from Nellie...

 From: NellieNellie  
 Date:  Jan 5 2007 1:09 AM
 Subject:  I want to be your favorite hello and your hardest goodbye.
 Body:  Since this is going to be the forth message to you, I will make this last one short. I keep getting errors on the page when I send it off

Here is my email address... pretyamethysts17m at yahoo..

I am seeking a friend for now, since I am newly single from my last bad relationship Like a friend with some added benefits type of thing eventually.

I'm adventurous, love to dance, love to drive fast, and love to watch sports, live. My best friend is always talking so highly about this site, always telling me how she met her boyfriend on here, so I decided to T.O. on her account and see if I have any luck, until I create my own account some time If I even decide to create my own, I dont want to spend too much time on here. She spends all day here sometimes, so I make fun of her alot. hehe.

Anyways, talk to you sometime. Byee!

So, when I got that email, I just started laughing... I think myspace had a great idea when it was started, but they totally sold everyone out! ;-)

That's why I stick with the only true and awesome stalker tool. But I won't tell you what it is...


Tags: Personal(20) Miscellaneous(1)
Let the additions continue!
time: 2007-01-09 20:53:13
music: Lead of Love
book: where wizards stay up late

Well, I have kept myself busy by constantly adding on to  this website.
Things are going well with me, even though the job search is slow. Luckily I have my family constantly supporting me with a house and a lot of understanding :-).

Additions to the site include super search B-) (yeah, I've also updated the emoticon library)! It now searches posts, projects, about me, and comments! But that's not what makes it super... it also highlights the keywords in the searched items and directs the page to the queried element (thanks to moo.fx.scroll)! It's pretty slick to watch! Also, the searches are Boolean, so you can type something like: +website -monkey and it will find everything to do with websites, but not monkeys (do your part to help keep monkeys off the Internet ;-)).

Tags are finally working, they just aren't visible to you yet. I'm having problems getting this site to work with FireFox. It's so odd. I used to only program for FireFox, and hated IE, but since I started using vista... the tables have changed (mainly do to Internet Explorer 7).

I think I'm going to start a new section for "tutorials." I think it'd be useful. i have several ideas on how to do it, but what I'm leaning towards is just a regular post, but with the special "tutorial" tag. then just handle such posts differently. It's a neat idea, because nothing would change (except for the user interface).

My Atom feed (Adam Feed) is working now. It's Atom 1.0 lol. I just barely flew in under the radar on that 1.0 too! If you don't know, there are open standards with how Atom feeds are made. Atom 2.0 are more strict. I'm going to work on my script that makes the feed to see if I can make it 2.0 compliant. Until then, you can subscribe.

I also am going to start adding a "ranking" for the music, posts, and projects. It'll be a star system where users can decide how much they like the stuff, but don't have to leave an actual comment.

So, I guess that's it for now. I'll keep yall in touch.


Tags: FollowerofJC.com(10)
<<previous page 1 2 3 4 5 6 7 8 9 next page>>