当前位置: 首页>>代码示例>>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;未经允许,请勿转载。