function update_page_content_db($page_name, $content, $uid)
{
    $con = connectToDB();
    if ($con) {
        $sql = "UPDATE `pagecontent` SET \n\t\t\t\t`pagecontent`='{$content}',\n\t\t\t\t`adminid`={$uid},\n\t\t\t\t`editeddate` = NOW( )\n\t\t\t\tWHERE `pagename`='{$page_name}';";
        $result = desql($sql);
        breakCon($con);
    }
    return $result;
}
function get_all_tags_db($class)
{
    $con = connectToDB();
    if ($con) {
        $sql = "SELECT DISTINCT `tag` FROM `techcsondemand`.`PostCollection{$class}` ORDER BY `tag`;";
        $rtn = array();
        $result = desql($sql);
        while ($row = mysql_fetch_row($result)) {
            $rtn[] = $row[0];
        }
        breakCon($con);
    }
    return $rtn;
}
function delete_media_db($id)
{
    $con = connectToDB();
    $rtn = 0;
    if ($con) {
        $sql = "DELETE `techcsondemand`.`CommentCollection` WHERE `commentid`=" . $comment->commentid . ";";
        $rtn = desql($sql);
        breakCon();
    }
    return $rtn;
}
function delete_post_db($id)
{
    $con = connectToDB();
    $rtn = 0;
    if ($con) {
        $sql = "DELETE `techcsondemand`.`PostCollection` WHERE `postid`={$id};";
        $rtn = desql($sql);
        breakCon();
    }
    return $rtn;
}
function unique_email_db($email)
{
    $con = connectToDB();
    if ($con) {
        $sql = "SELECT * FROM `techcsondemand`.`TaCollection` WHERE `email`='{$email}';";
        $result = desql($sql);
        $num_results = mysql_num_rows($result) ? 0 : 1;
        breakCon($con);
        return $num_results;
    }
    return 0;
}
 function addClass($newClassId)
 {
     $this->classId[] = $newClassId;
     $con = connectToDB();
     update_ta_add_class_db($this->id, $newClassId);
     breakCon($con);
 }