Friday, June 8, 2007

What I hope to do here

I thought it would be good to start with what I plan to do on this blog exactly.

Every day I work on web sites, whether I'm making little fixes to bugs, or writing entire applications. Here is where I plan to document my progress.

I'm pretty much self taught with web development, I've been writing the back-end of websites for 10 years now! When I discover new things, or simply want to be able to lookup for myself where I've done something in the past, this is the place I'll come.

Each week day I plan to write a short description on what code I wrote (if any) and what it did, and perhaps filename(s) for my own reference.. at least code snippets for others.

Often I find small niggling errors that I can't find the answer to. I'm positive that someone else must have seen it before, but get frustrated trying to find the solution. I google for the answer, and all I get is uber geeks belittling people like me asking questions on forums. Here I hope to write up solutions to these simple things, and hope that people offer me feedback.. especially when I ask questions!

The question now is.. what did I do today?
1. I updated my personal website with some text. Basically it's been horribly neglected, and it's only real purpose is to post my photo's for family and friends.

2. Wrote some code and fixed a SQL select statement for picking live content (checking to see if it's active, and if the start date is passed, and the end date has not passed) from a small content manager I wrote (in a hurry).
I had to do a sort of work around. You see the users who enter the content into the CMS enter the date/time as local pacific time. This creates a problem, since the servers are set to GMT. The problem isn't quite solved yet, but this is what I have now:

putenv("TZ=US/Pacific");
$now_time=date("Y-m-d H:i:s");
$query="SELECT id FROM tablename WHERE is_active=1 AND (datetime_start < '".$now_time."' and datetime_end > '".$now_time."')";

I know putenv isn't the best way to do this, but I am working in PHP4, so the new timezone functions in PHP5 aren't available to me.

Well that's it for today, and it's Friday, so no more posting til Monday!

BFN

No comments: