コード例 #1
0
ファイル: SmsLog.php プロジェクト: TaylorMonacelli/phplib
        $db->query("SELECT COUNT(*) as total from SmsLog where " . $query);
        $db->next_record();
        if ($db->f("total") < $q->start_row - $q->row_count) {
            $q->start_row = $db->f("total") - $q->row_count;
        }
        if ($q->start_row < 0) {
            $q->start_row = 0;
        }
        if (!$sortorder) {
            $sortorder = "id";
        }
        $query .= " Order By " . $sortorder . " LIMIT " . $q->start_row . "," . $q->row_count;
        // In any case we must display that form now. Note that the
        // "x" here and in the call to $q->where must match.
        // Tag everything as a CSS "query" class.
        printf($q->form("x", $t->map_cols, "query"));
        printf("<hr>");
        // if (!$query) { $query="id!='0'"; }
        // Do we have a valid query string?
        if ($query) {
            // Show that condition
            printf("Query Condition = %s<br>\n", $query);
            // Do that query
            $db->query("select * from SmsLog where " . $query);
            // Dump the results (tagged as CSS class default)
            printf("Query Results = %s<br>\n", $db->num_rows());
            $t->show_result($db, "default");
        }
}
// switch $cmd
page_close();