예제 #1
1
 public static function checkLogin($userName, $password)
 {
     $sql = "select * from manager where userName='******' and password='******'";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->close();
     return $result[0];
 }
예제 #2
1
 public static function getNewsTypes()
 {
     $sql = "select * from newsTypes";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->freeResult();
     $conn->close();
     return $result;
 }
예제 #3
0
 public static function getReviews($articleId)
 {
     $sql = "select * from reviews where articleId={$articleId}";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->freeResult();
     $conn->close();
     return $result;
 }
예제 #4
0
// Dateiname: public_vars.php
$PUBLICVARS = array();
/* ---------------------------------------
    Globale Variablen-Definitionen 
--------------------------------------- */
$url = parse_url(__FILE__);
$currPath = dirname($url['path']);
if (substr($currPath, strlen($currPath) - 1) != "/" && strlen($currPath) > 1) {
    $currPath .= "/";
}
include $currPath . "dbConnect.php";
$dc = new DbConn($DBHOST, $DBUSER, $DBPASS, $DBNAME);
// Muss immer neu geladen werden,
// da Session hier noch nicht gestartet werden kann weil Klassen noch nicht geladen sind!
$sql = "select name, value from pageconfig ";
$res = $dc->executeQuery($sql);
while ($row = mysql_fetch_array($res)) {
    $PUBLICVARS[$row['name']] = $row['value'];
}
class DbConn
{
    var $host;
    var $user;
    var $pass;
    var $dbname;
    var $db_link = false;
    function DbConn($DBHOST, $DBUSER, $DBPASS, $DBNAMEX)
    {
        //Konstruktor
        $this->host = $DBHOST;
        $this->user = $DBUSER;
예제 #5
0
 public static function getNewsTwo($typeId)
 {
     $sql = "select * from newsArticles where typeId={$typeId} order by dateandtime desc limit 0,2";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->freeResult();
     $conn->close();
     return $result;
 }