http://www.elated.com/articles/add-article-categories-to-your-cms/
Learn how to modify a PHP and MySQL content management system to include support for article categories. Full CMS code download included.
|

class Image
{
public $id = null;
public $path = null;
public $article_Id = null;
/*
* Constructor
* @params $id primary key in database to be incremented.
* @params $path path of the upload image
* @params $article_id, foriegn key to be gotten from the article
*/
public function __construct($pic = array())
{
if (isset($pic['id']))
$this->id = (int)$pic['id'];
if(isset($pic['img']))
$this->path = $pic['path'];
if(isset($pic[article_Id]))
$this->article_Id = (int)$pic['article_Id'];
}

<option value="0"<?php echo !$category->id ? " selected" : ""?>>(none)</option>
<option value="0"<?php echo !$results['article']->categoryId ? " selected" : ""?>>(none)</option>
define( "SUBADMIN_USERNAME", "subadmin" );
define( "SUBADMIN_PASSWORD", "anotherpass" );
if ( $_POST['username'] == ADMIN_USERNAME && $_POST['password'] == ADMIN_PASSWORD || $_POST['username'] == SUBADMIN_USERNAME && $_POST['password'] == SUBADMIN_PASSWORD ) {
...etc...

public static function getList( $numRows=1000000, $categoryId=null, $order="publicationDate DESC" ) {
$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
$categoryClause = $categoryId ? "WHERE categoryId = :categoryId" : "";
$sql = "SELECT SQL_CALC_FOUND_ROWS *, UNIX_TIMESTAMP(publicationDate) AS publicationDate
FROM articles $categoryClause [b]WHERE (id > 2)[/b]
ORDER BY " . mysql_escape_string($order) . " LIMIT :numRows";

function viewInfo() {
$results = array();
$data = Info::getList();
$results['staticinfo'] = $data['results'];
$results['pageTitle'] = "Info | Kanske";
require( TEMPLATE_PATH . "/viewInfo.php" );}
Maybe you could post the problem along with your complete code in a new topic, and we can take a closer look:
<form enctype="multipart/form-data" ...>