コード例 #1
0
function display_db_table($page, $tablename, $connection, $image, $table_params)
{
    $order_by = isset($_GET['order_by']) ? $_GET['order_by'] : 'Reference';
    $sorting = isset($_GET['sorting']) ? $_GET['sorting'] : 'desc';
    switch ($sorting) {
        case "asc":
            $sort = 'desc';
            break;
        case "desc":
            $sort = 'asc';
            break;
    }
    $query_string = "SELECT * FROM {$tablename} ORDER BY {$order_by}" . " {$sort}";
    display_db_query($page, $query_string, $connection, $sort, $image, $table_params);
}
コード例 #2
0
ファイル: gamesold.php プロジェクト: venomslair/venomslair
function display_db_table($tablename, $connection, $header_bool, $table_params)
{
    $query_string = "SELECT title, console, xbox_live, last_updated FROM games ORDER BY title ASC";
    display_db_query($query_string, $connection, $header_bool, $table_params);
}
コード例 #3
0
ファイル: hebconj-list.php プロジェクト: hftf/hebconj
mysql_query("SET NAMES \"utf8\"");
?>

<h2>Hebrew Verbs List</h2>
<p>The <strong>Hebrew Verb Conjugator</strong> is a work in progress. The following table includes almost all Hebrew verbs in each of the seven <a href='http://en.wikipedia.org/wiki/Binyan'>constructions</a>. Click on a verb in the <code>verb_root</code> column to conjugate it. Click on a column header to <a href='http://www.kryogenix.org/code/browser/sorttable/'>sort</a>. Only verbs in <em>Tables 1 through <?php 
$r = mysql_fetch_row(mysql_query("select count(*) from tables"));
echo $r[0];
?>
</em> without a <a href='http://en.wikipedia.org/wiki/Final_form'>sofit</a> currently work as expected, and only about <em><?php 
$r = mysql_fetch_row(mysql_query("select count(*) from verbs where verb_root != ''"));
echo $r[0];
?>
 of 2500</em> verbs have been included. The verbs of the as yet empty tables will be inserted soon, and more functionality will continually be added, so return here in the near future to see updates. Please note that the verbs have been manually entered, and may contain errors; if you find any, contact me at <a href='mailto:hangfromthefloor+hvc@gmail.com'>hangfromthefloor+hvc@gmail.com</a>.</p>

<?php 
display_db_query("SELECT verb_id, verbs.table_id, verb_root, tense_name, tense_id, LENGTH(table_rule)\n  FROM verbs\n  LEFT JOIN tenses ON (verbs.table_id >= tenses.table_id_start AND verbs.table_id <= tenses.table_id_end)\n  LEFT JOIN tables ON (verbs.table_id = tables.table_id)", $connection);
function display_db_query($query_string, $connection)
{
    $result_id = mysql_query($query_string, $connection) or die(mysql_error());
    $column_count = mysql_num_fields($result_id) or die(mysql_error());
    echo "<table class=\"sortable\" border=\"1\" style=\"width:auto;margin-top:1em;\">\n<tr>";
    for ($column_num = 0; $column_num < $column_count - 1; $column_num++) {
        echo "<th>", mysql_field_name($result_id, $column_num), "</th>";
    }
    echo "</tr>\n";
    while ($row = mysql_fetch_row($result_id)) {
        echo "<tr>";
        for ($column_num = 0; $column_num < $column_count - 1; $column_num++) {
            echo "<td class=\"c{$column_num}\">";
            if ($column_num == 2) {
                echo "<a href=\"hebconj.php?verb_root=", urlencode($row[$column_num]), "&amp;tense_id={$row[4]}\">";
コード例 #4
0
ファイル: core.php プロジェクト: rogerlzp/android-acra-server
function display_db_table($tablename, $connection, $names)
{
    $fields = array("APP_VERSION_NAME", "USER_CRASH_DATE", "ANDROID_VERSION", "PHONE_MODEL", "PACKAGE_NAME", "STACK_TRACE");
    $query_string = 'SELECT ' . implode(',', $fields) . ' FROM ' . $tablename;
    display_db_query($query_string, $connection, $names);
}