/**
  * 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);
 }
Beispiel #2
0
 public function getCount($query)
 {
     return parent::num_rows($query);
 }
Beispiel #3
0
<?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'];
        ?>