本文整理汇总了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> ';
}
示例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++;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例8: GetConfigProcess
public function GetConfigProcess()
{
parent::query('SELECT * FROM dd_config');
parent::execute();
$dataset = parent::resultset();
return $dataset;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例14: EditProductProcess
public function EditProductProcess($param)
{
parent::query('SELECT * FROM dd_product');
parent::execute();
parent::execute();
$dataset = parent::resultset();
return $dataset;
}
示例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;
}