當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Database::resultset方法代碼示例

本文整理匯總了PHP中Database::resultset方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database::resultset方法的具體用法?PHP Database::resultset怎麽用?PHP Database::resultset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Database的用法示例。


在下文中一共展示了Database::resultset方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: RenderPage

    public function RenderPage()
    {
        require_once "/Classes/databaseHandler.class.php";
        $Database = new Database();
        print '
        <title>Run2Day - Bannerbeheer</title>
        <h1>Bannerbeheer</h1>
        <table class="table">
                            <tr>
                                <th>Toegevoegd aan</th>
                                <th>Bestandsnaam</th>
                                <th>Banner tekst</th>
                                <th>Verwijderen</th>
                            </tr> ';
        $Database->query('SELECT ID, fileName, fk_wedstrijdID, text  FROM afbeeldingen');
        $result = $Database->resultset();
        foreach ($result as $key) {
            $Database->query('SELECT name  FROM wedstrijden WHERE wedstrijdID=?');
            $Database->bind(1, $key['fk_wedstrijdID']);
            $wedstrijd = $Database->single();
            print '<tr><td>' . $wedstrijd['name'] . ' </td>';
            print '<td>' . $key['fileName'] . ' </td>';
            print '<td>' . $key['text'] . ' </td>';
            print ' <td><a class="fa fa-trash-o"  href="?dashboard&deletebanner=' . $key['ID'] . '"</td></tr>';
        }
        print '
            </table>


   <div class="col-md-4">
   <h3>Banner afbeelding toevoegen</h3>
   <form action="../Classes/submitWedstrijd.php" method="POST"  enctype="multipart/form-data">

      <label for="usr">Banner toevoegen aan:</label>
      <select class="form-control" name="wedstrijd" id="wedstrijd">';
        $Database->query('SELECT name, wedstrijdID FROM wedstrijden');
        $result = $Database->resultset();
        foreach ($result as $key) {
            print '  <option> ' . $key['name'] . '</option>';
        }
        print '
</select>

    <div class="form-group">
      <label for="usr">Banner tekst:</label>
      <input type="text" class="form-control" id="name" name="name" required>
    </div>

      <div class="form-group">
      <label for="usr">Afbeelding:</label>
        <input type="file" name="file" id="file">
            </div>
           <input type="submit" value="Opslaan">
    <br><br>
  </form>
   </div>
</div>
</div> ';
    }
開發者ID:WouterDoornbos,項目名稱:Run2Day,代碼行數:59,代碼來源:bannermanager.php

示例2: mainP

 public function mainP()
 {
     $sen = 0;
     $db = new Database();
     foreach ($this->sentences as $sentence) {
         $highest = 0;
         $words = array();
         $words = explode(" ", $sentence);
         foreach ($words as $word) {
             if (!in_array(strtolower($word), $this->stopwords)) {
                 //Fetching the meaning definition of the senses From the WordNet
                 $db->query("SELECT * from words where lemma like :word");
                 $db->bind("word", $word);
                 $wordid = $db->single()->wordid;
                 $db->query("SELECT * from senses where wordid like :wordid");
                 $db->bind("wordid", $wordid);
                 $resulta2 = $db->resultset();
                 foreach ($resulta2 as $row) {
                     $synsetid = $row->synsetid;
                     $sample2[] = $synsetid;
                     $title = $row->wordid . " " . $row->senseid;
                 }
                 $db->query("select * from synsets where synsetid like :sample");
                 $db->bind("sample", $sample2[0]);
                 $resulta3 = $db->resultset();
                 unset($sample2[0]);
                 for ($i = 0; $i < count($sample2) + 1; $i++) {
                     ${result_A . $i} = $sample2[$i];
                     ${lexdomains_var . $i} = $lexdomains[$i];
                     $db->query("select * from synsets where synsetid like :sample");
                     $db->bind("sample", ${result_A . $i});
                     ${result . $i} = $db->resultset();
                     foreach (${result . $i} as $row) {
                         ${pos . $i} = $row->pos;
                         if (${pos . $i} == "s") {
                             ${pos . $i} = "satellite adj";
                         }
                         $def = $row->definition;
                         $def = preg_replace('/[^a-zA-Z0-9_ -]/s', '', $def);
                         $definition = array();
                         $definition = explode(" ", $def);
                         $frequency = $this->frequency($definition);
                         if ($frequency > $highest) {
                             $highest = $frequency;
                         }
                     }
                 }
                 $sample2 = array();
             }
         }
         $this->frequencies[] = $highest;
         $this->sentence_count[] = $sen;
         $sen++;
     }
 }
開發者ID:TEJATJ,項目名稱:textsummary,代碼行數:55,代碼來源:TextSummary.php

示例3: userPostCount

function userPostCount($user_id)
{
    $db = new Database();
    //topic count
    $db->query("SELECT * FROM topics\n\t\t\t\tWHERE user_id = :user_id\n\t\t\t\t");
    $db->bind(":user_id", $user_id);
    $rows = $db->resultset();
    $topic_count = $db->rowCount();
    //reply count
    $db->query("SELECT * FROM replies\n\t\t\t\tWHERE user_id = :user_id\n\t\t\t\t");
    $db->bind(":user_id", $user_id);
    $rows = $db->resultset();
    $reply_count = $db->rowCount();
    return $topic_count + $reply_count;
}
開發者ID:jprichter,項目名稱:Forum,代碼行數:15,代碼來源:db_helper.php

示例4: getByMuseum

function getByMuseum($museum_id, $today)
{
    global $api_response;
    global $api_response_code;
    try {
        $database = new Database();
        $database->query("SELECT * FROM exhibitions_info WHERE end_date >= :today AND museum_id = :museum_id ORDER BY start_date ASC");
        $database->bind(':today', $today);
        $database->bind(':museum_id', $museum_id);
        $rows = array();
        $rows = $database->resultset();
        $database = null;
        if ($rows == null) {
            //not found any exhibitions return error
            $api_response = $api_response_code[5];
        } else {
            $api_response = $api_response_code[1];
        }
        return $rows;
    } catch (PDOException $e) {
        $database = null;
        $api_response = $api_response_code[0];
        //die( "Query failed: " . $e->getMessage() );
        return null;
    }
}
開發者ID:sarahjohnston,項目名稱:masters_project,代碼行數:26,代碼來源:index.php

示例5: fetchBySearch

 public function fetchBySearch($search)
 {
     $dbh = new Database();
     $data = $dbh->query('SELECT * FROM tiendas WHERE tienda_nombre LIKE "%' . $search . '%"');
     $data = $dbh->resultset();
     return $data;
 }
開發者ID:hugodom,項目名稱:Multiplaza,代碼行數:7,代碼來源:model.Tiendas.php

示例6: fetchAllByPortada

 public function fetchAllByPortada()
 {
     $dbh = new Database();
     $data = $dbh->query('SELECT * FROM noticias WHERE noticia_portada = 1 LIMIT 3');
     $data = $dbh->resultset();
     return $data;
 }
開發者ID:hugodom,項目名稱:Multiplaza,代碼行數:7,代碼來源:model.Noticias.php

示例7: fetchAllNonPremieres

 public function fetchAllNonPremieres()
 {
     $dbh = new Database();
     $data = $dbh->query('SELECT * FROM cine WHERE cine_estreno = 0 AND cine_activado = 1');
     $data = $dbh->resultset();
     return $data;
 }
開發者ID:hugodom,項目名稱:Multiplaza,代碼行數:7,代碼來源:model.Cine.php

示例8: GetConfigProcess

 public function GetConfigProcess()
 {
     parent::query('SELECT * FROM dd_config');
     parent::execute();
     $dataset = parent::resultset();
     return $dataset;
 }
開發者ID:jimmy18dev,項目名稱:dotdotdot_store,代碼行數:7,代碼來源:config.model.php

示例9: ListDistrictProcess

 public function ListDistrictProcess($param)
 {
     parent::query('SELECT * FROM dy_location_district WHERE ds_city_id = :city_id ORDER BY ds_id ASC');
     parent::bind(':city_id', $param['city_id']);
     parent::execute();
     return parent::resultset();
 }
開發者ID:jimmy18dev,項目名稱:dailypoint,代碼行數:7,代碼來源:location.model.php

示例10: ListConfigProcess

 public function ListConfigProcess($group)
 {
     parent::query('SELECT * FROM dd_config WHERE cf_group = :group');
     parent::bind(':group', $group);
     parent::execute();
     $dataset = parent::resultset();
     return $dataset;
 }
開發者ID:jimmy18dev,項目名稱:dotdotdot_store,代碼行數:8,代碼來源:config.model.php

示例11: getComments

 /**
  * Get Post Comments
  *
  * @param int $post_id
  * @return mixed
  */
 public function getComments($post_id)
 {
     $this->db->query("SELECT comments.*, posts.id FROM comments\n\t        INNER JOIN posts\n\t        ON comments.post_id = posts.id\n\t        WHERE comments.post_id = :post_id\n\t\t\tORDER BY time ASC");
     $this->db->bind(':post_id', $post_id);
     //Assign Result Set
     $results = $this->db->resultset();
     return $results;
 }
開發者ID:GojkoC,項目名稱:Simple_Blog,代碼行數:14,代碼來源:Post.php

示例12: commentsCount

function commentsCount($post_id)
{
    $db = new Database();
    $db->query("SELECT * FROM comments WHERE post_id = :post_id");
    $db->bind(':post_id', $post_id);
    $rows = $db->resultset();
    return $db->rowCount();
}
開發者ID:GojkoC,項目名稱:Simple_Blog,代碼行數:8,代碼來源:db_helper.php

示例13: printHTML

 public function printHTML()
 {
     require_once "/Classes/databaseHandler.class.php";
     $Database = new Database();
     $Database->query('SELECT wedstrijdID, name, date, location  FROM wedstrijden');
     $this->wedstrijden = $Database->resultset();
     $this->RenderPage();
 }
開發者ID:WouterDoornbos,項目名稱:Run2Day,代碼行數:8,代碼來源:wedstrijden.php

示例14: EditProductProcess

 public function EditProductProcess($param)
 {
     parent::query('SELECT * FROM dd_product');
     parent::execute();
     parent::execute();
     $dataset = parent::resultset();
     return $dataset;
 }
開發者ID:jimmy18dev,項目名稱:dotdotdot_store,代碼行數:8,代碼來源:image.model.php

示例15: PlaceToTagCheckingProcess

 public function PlaceToTagCheckingProcess($param)
 {
     parent::query('SELECT tg_id tag_id,tg_keyword tag_keyword,tg_text tag_text,tg_create_time tag_create_time,(SELECT pt_id FROM dy_place_to_tag WHERE pt_place_id = :place_id AND pt_tag_id = tg_id) tag_checking FROM dy_tag WHERE 1 ORDER BY tg_create_time DESC');
     parent::bind(':place_id', $param['place_id']);
     parent::execute();
     $dataset = parent::resultset();
     return $dataset;
 }
開發者ID:jimmy18dev,項目名稱:dailypoint,代碼行數:8,代碼來源:tag.model.php


注:本文中的Database::resultset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。