Hello, I am a new addition to the seething throngs of PHP Coders running about with our spiffy new database driven websites getting nice, fast page loads and the usual cornucopia of problems associated with doing anything on a computer for the first time.

Now, my story goes something like this: I have a vBulletin liscense and my host allows two databases for each domain name (I own three), my primary domain has one database occupied by vBulletin and the other one occupied by a corrupted database, I've asked them to get rid of this several times but I digress. This forces me to store my primary sites information into the vB database which, by itself, isn't a problem. However as a means of trying to limit the amount of tables I add to an already horrendously crowded and difficult to work with database I only want to do two, one for Articles, and one for the little post-things I disperse around my site as information on pages (one of these "posts" is typically a paragraph or two encapsulated in a table, there are two on my front page, four on my Copyright page, five on my Privacy Policy page etc, etc). I've also arranged this so I can simply add these posts with a submit form in a Private Area of my site (which I have yet to implement any real sort of user access system other then making it an .php?action=specialcommandthatnobodyknows to prevent the unwashed masses from wreaking havoc, I hope Mr. Yank or someone else writes a book on Sessions soon-if anyone knows of a good tutorial for this, please tell me) and there is a textarea called "page" which I would want to put in the name of the page of my site where I would like the given post to appear, hence the WHERE clause.

I already I could solve this problem by simply creating seperate tables for each page on my site but that is grossly inefficient by my reckoning and you really don't learn anything by avoiding problems, hence this topic.

Currently I'm using this to query the database on the front page which just fetches everything in my site_post table

$result = @mysql_query("SELECT id, ptitle, content, page, displayorder, date_posted FROM site_post ORDER BY displayorder");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}

I tried adding this immediately after 'ORDER BY displayorder' " WHERE page=news" which seemed to me like it should work, only selecting the rows where the 'page' column had the value of 'news' putting it on the front page but, lo and behold, SQL gave me a bad syntax error. Help?