本文整理汇总了PHP中BD::NumRows方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::NumRows方法的具体用法?PHP BD::NumRows怎么用?PHP BD::NumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::NumRows方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Evento
/**
* Construtor
* @param int $id
* @return void
*/
function Evento($idevento)
{
$db = new BD();
$sql = sprintf("select\n\t\t\t id,\n\t\t\t data,\n\t\t\t local,\n\t\t\t descricao\n\t\t\t from\n cad_eventos\n where id= %d", $idevento);
$db->Query($sql);
if ($db->NumRows() == 0) {
$this->Existe = 'N';
} else {
$this->Existe = 'S';
$db->Next();
$this->ID = $idevento;
$this->Data = $db->getValue('data');
$this->Local = $db->getValue('local');
$this->Descricao = $db->getValue('descricao');
}
$db->Close();
}
示例2: Reuniao
/**
* Construtor
* @param int $id
* @return void
*/
function Reuniao($id)
{
$db = new BD();
$sql = sprintf("select\n\t\t\t id,\n\t\t\t data,\n\t\t\t hora,\n\t\t\t local\n\t\t\t from\n cad_reuniao\n where id= %d", $id);
$db->Query($sql);
if ($db->NumRows() == 0) {
$this->Existe = 'N';
} else {
$this->Existe = 'S';
$db->Next();
$this->ID = $id;
$this->Data = $db->getValue('data');
$this->Hora = $db->getValue('hora');
$this->Local = $db->getValue('local');
}
$db->Close();
}
示例3: Calendario
/**
* Construtor
* @param int $id
* @return void
*/
function Calendario($id)
{
$db = new BD();
$sql = sprintf("select\n\t\t\t idcalendario,\n\t\t\t dataevento,\n\t\t\t titulo,\n\t\t\t descricao,\n\t\t\t local,\n\t\t\t realizacao\n\t\t\t from\n tb_calendario\n where idcalendario= %d", $id);
$db->Query($sql);
if ($db->NumRows() == 0) {
$this->Existe = 'N';
} else {
$this->Existe = 'S';
$db->Next();
$this->ID = $id;
$this->Data = $db->getValue('dataevento');
$this->Titulo = $db->getValue('titulo');
$this->Descricao = $db->getValue('descricao');
$this->Local = $db->getValue('local');
$this->Realizacao = $db->getValue('realizacao');
}
$db->Close();
}
示例4: Enquete
/**
* Construtor
* @param int $userid
* @return void
*/
function Enquete($codigo)
{
$db = new BD();
$sql = sprintf("select\n\t\t\t numero,\n\t\t\t pergunta,\n\t\t\t datainicio,\n\t\t\t datafim,\n\t\t\t tiporesposta,\n\t\t\t restrita\t\t\t \n\t\t\t from\n cad_enquete\n where numero= %d", $codigo);
$db->Query($sql);
if ($db->NumRows() == 0) {
$this->Existe = 'N';
} else {
$this->Existe = 'S';
$db->Next();
$this->Codigo = $codigo;
$this->Pergunta = $db->getValue('pergunta');
$this->DataInicio = $db->getValue('datainicio');
$this->DataFim = $db->getValue('datafim');
$this->TipoResposta = $db->getValue('tiporesposta');
$this->Restrita = $db->getValue('restrita');
$this->CarregaOpcoes();
}
$db->Close();
}
示例5: BD
<tr><td colspan=10 align="center">
<div style="width:430px;border:solid 1px #a0b0b0;background:#fff;">
<table style="width:450px;" width="450px" bordercolor="white" class='dettab' border="1px" cellspacing=0 frame="box" rules="all">
<?php
require_once $_SESSION['DOCROOT'] . "/classes/class.bd.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.usuario.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.campeonato.php";
require_once $_SESSION['DOCROOT'] . "/classes/class.inscricao.php";
$db = new BD();
$sql = sprintf("select i.campeonato,i.userid " . "from " . "cad_inscricao i, " . "cad_usuario u, " . "cad_campeonato c " . "where " . "i.campeonato = c.codigo " . "and i.userid = u.userid " . "and c.flandamento = 'S' and c.codigo = 4 " . "order by " . "c.ano desc," . "i.campeonato," . "i.posefetiva," . "u.username");
$db->Query($sql);
$camp = 0;
$posant = 0;
$pos = 0;
if ($db->NumRows() == 0) {
echo ' <tr> <td>Não existe campeonatos cadastrados ou em andamento no momento.<br></td> </tr>' . "\n";
} else {
while ($db->Next()) {
if ($camp != $db->getValue('campeonato')) {
if ($camp != 0) {
echo "<tr><td colspan=4><br></td></tr>\n";
}
$pos = 0;
$cmp = new Campeonato($db->getValue('campeonato'));
echo "<tr style='background:rgb(250, 252, 188);color:rgb(0, 102, 0);'><td colspan=10 align=center><b>" . $cmp->getDescricaoAno() . "</td></tr>\n";
echo "<tr style='background:rgb(250, 252, 188);color:rgb(0, 102, 0);'><td colspan=3 align=center><b>Classificação do Bolão</td>\n\t\t\t\t\t\t\t</tr>\n";
$camp = $cmp->getCodigo();
echo "<tr class='cabec'><td align=center>Pos</td><td>Participante</td><td align=center>Pontos</td></tr>\n";
}
$usr = new Usuario($db->getValue('userid'));