Ejemplo n.º 1
0
function dbIdListOfPage(&$session, $table, $where, $page_size, $page)
{
    $session->trace(TC_Db3 + TC_Query, "dbIdListOfPage: {$table}, {$where}");
    $rc = array();
    $query = 'select id from ' . dbTable($session, $table) . " where {$where}";
    $result = mysql_query($query, $session->fDbInfo);
    if (!$result) {
        protoc(mysql_error());
    } else {
        if (($offset = $page_size * ($page - 1)) != 0) {
            mysql_data_seek($result, $offset);
        }
        while (count($rc) < $page_size && ($row = mysql_fetch_row($result))) {
            array_push($rc, $row[0]);
        }
        mysql_free_result($result);
    }
    return $rc;
}
Ejemplo n.º 2
0
function dbSingleValue(&$session, $query)
{
    $session->trace(TC_Db3 + TC_Query, "dbSingleValue: {$query}");
    dbInit($session);
    $value = "";
    $result = mysql_query($query, $session->fDbInfo);
    if (!$result) {
        protoc(mysql_error());
    } else {
        $row = mysql_fetch_row($result);
        if ($row) {
            $value = $row[0];
            mysql_free_result($result);
        }
        // $row
    }
    $session->trace(TC_Query, "dbSingleValue Wert: {$value}");
    return $value;
}
Ejemplo n.º 3
0
function addressPrintTable(&$session, $query, $max_lines)
{
    $result = mysql_query($query, $session->fDbInfo);
    if (!$result) {
        protoc(mysql_error());
    } else {
        guiHeadline($session, 2, 'Suchergebnis:');
        $first = true;
        $no = 0;
        if ($max_lines <= 0) {
            $max_lines = 1000;
        }
        outTable(1);
        while ($row = mysql_fetch_row($result)) {
            if ($first) {
                addressPrintTableHeader($session);
                $first = false;
            }
            if (++$no > $max_lines) {
                break;
            }
            outTableRecord();
            addressPrintRow($session, $row);
            outTableRecordEnd();
        }
        if ($first) {
            echo "Die Anfrage ergab keine Ergebnisse";
            outNewline();
        } else {
            outTableEnd();
            if ($no > $max_lines) {
                guiParagraph($session, "Es gibt noch weitere Ergebnisse!", false);
            }
        }
        mysql_free_result($result);
    }
}
Ejemplo n.º 4
0
function error($message)
{
    protoc('<h1>+++ ' . $message . '</h1>');
}
Ejemplo n.º 5
0
function error($message)
{
    protoc(TAG_H1 . '+++ ' . $message . TAG_H1_END);
}