Sep 22, 2010 13:22
It works now.
It rejects invalid logins. It accepts new posts into the database. It displays the posts in the database.
Design note I picked up- When using joined tables from within PHP, and I suppose any programming language, life is much easier when you use column aliases. DB_FETCHMODE_ASSOC is also a friend of mine now. Lets me use descriptive names for what I pull out of my query rows. Not a huge deal for two databases of 5 columns each, but if things grow much beyond that, it would be a nightmare to keep it all straight with numbers. I suppose I might investigate using numbers if I hit a performance problem and had tried basically everything else and it still isn't fast enough. But at that point I'd probably be taking a serious look at using a compiled language.
I like the PHP session tracking. So much simpler than the wild homebrew schemes I had been sketching out in my head.
This project has renewed my love of Unix. "cat apache_error_log | grep php" has been critically important. I've also gotten a bit better with vi in this project.
There are some important features missing. Pagination for one. Better(read any at all) input validation would be kind of useful. At some point I should probably work out a better login system- passwords plaintext literally everywhere they show up is not a particularly good design from a security standpoint. Might be smart to not hardcode the database name, database user, and database password. The ability to save a login for next time you come back would be a nice usability enhancement. Comments are on my list to add at some point.
But I think I'll take a step back from the backend coding and tidy up the user interface. As is, it is functional at best. While I'm in the functional > pretty camp, a well done UI isn't just pretty, it makes things more functional even with the exact same featureset. I probalby won't turn out a brilliant ui, but with a bit of work I can do better than I have now.
sql,
php,
programming