本文整理汇总了PHP中Mysql::num_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::num_rows方法的具体用法?PHP Mysql::num_rows怎么用?PHP Mysql::num_rows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::num_rows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _showImg
/**
* Anzeige des Bildes
*
* @param unknown_type $img_ID
*/
private function _showImg($img_ID)
{
$this->_tplfile = 'gallery_pic.tpl';
//Die benötigten Daten für das Bild von der DB holen
$this->_mysql->query("SELECT `gallery_eintraege`.`fid_bild`, `gallery_eintraege`.`fid_album`,\n\t\t\t`gallery_eintraege`.`sequence`,\t`gallery_eintraege`.`sequence`, `bilder`.`filename`, \n\t\t\t`gallery_alben`.`ref_ID`, `gallery_alben`.`name`\n\t\tFROM `bilder`, `gallery_eintraege`, `gallery_alben`\n\t\tWHERE `fid_bild` = '{$img_ID}' AND `bilder_ID` = '{$img_ID}' AND `gallery_alben`.`ID` = `gallery_eintraege`.`fid_album`\n\t\tLIMIT 1");
$shown_bild = $this->_mysql->fetcharray("assoc");
//Zur Vereinfachung
$album_ID = $shown_bild['fid_album'];
$bild_sequence = (int) $shown_bild['sequence'];
$album_name = $shown_bild['name'];
/* Wurzel bestimmen */
$root = $this->_getRoot($shown_bild['ref_ID'], true);
/* Zahlen ermitteln */
$this->_mysql->query("SELECT * FROM gallery_eintraege WHERE fid_album = '{$album_ID}'");
$count = $this->_mysql->num_rows();
//Das vordere Bild
$this->_mysql->query("SELECT `fid_bild` FROM `gallery_eintraege`\n\t\t\t\t\t\t\tWHERE `sequence` < '{$bild_sequence}' and `fid_album` = '{$album_ID}'\n\t\t\t\t\t\t\tORDER BY sequence DESC Limit 1");
$prev_bild = $this->_mysql->fetcharray("assoc");
//Das hintere Bild
$this->_mysql->query("SELECT `fid_bild` FROM `gallery_eintraege`\n\t\t\t\t\t\t\tWHERE `sequence` > '{$bild_sequence}' and `fid_album` = '{$album_ID}'\n\t\t\t\t\t\t\tORDER BY sequence ASC Limit 1");
$next_bild = $this->_mysql->fetcharray("assoc");
//Smarty-Variablen
$this->_smarty->assign("album", array('ID' => $album_ID, 'name' => $album_name));
$this->_smarty->assign(array('ID_bild' => $img_ID, 'prev_bild' => $prev_bild['fid_bild'], 'next_bild' => $next_bild['fid_bild'], 'filename' => $shown_bild['filename'], 'count' => $count, 'number' => $shown_bild['sequence']));
$this->_smarty->assign("root", $root);
}
示例2: getCount
public function getCount($query)
{
return parent::num_rows($query);
}
示例3: Mysql
<?php
//please try to comment code in english
include "mysql.php";
if (isset($_REQUEST['pos'])) {
$inicio = $_REQUEST['pos'];
} else {
$inicio = 0;
}
$mysql = new Mysql();
$mysql->conexion();
// Creamos la variable consulta que nos servira como argumento en los metodos num_rows y fetch_array
$consulta = $mysql->consulta("SELECT * from empleados limit {$inicio},3");
//si existe por lo menos un campo
if ($mysql->num_rows($consulta) > 0) {
echo "se encontraron valores";
//Guardaremos en la variable $resultado en Array que nos devuelva
?>
<table id="resultados" border=1px>
<tr><td>Cedula</td><td>nombre</td><td>telefono y celular</td><td>Cedula</td><td>Cedula</td><td>Cedula</td></tr>
<?php
$impresos = 0;
while ($resultado = $mysql->fetch_array($consulta)) {
$impresos++;
?>
<tr><td><?php
echo $resultado['Cedula'];
?>
</td><td><?php
echo $resultado['Nombres'];
?>