当前位置: 首页>>代码示例>>PHP>>正文


PHP mysql::num_rows方法代码示例

本文整理汇总了PHP中mysql::num_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::num_rows方法的具体用法?PHP mysql::num_rows怎么用?PHP mysql::num_rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mysql的用法示例。


在下文中一共展示了mysql::num_rows方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql

        echo json_encode($arr);
    } else {
        array_push($arr, 0);
        // retrieve failed
        echo json_encode($arr);
    }
}
// **********************************************************************************
// GET EVENT NAME BY EVENT ID
// **********************************************************************************
if ($_REQUEST['ACTIONS'] == 'GET_EVENT_NAME_BY_ID') {
    $id = $_REQUEST['EVENT_ID'];
    $mysql = new mysql();
    $name = "";
    $result = $mysql->query("SELECT name, startTime\r\n\t\t\t\t\tFROM " . $eventTableName . "\r\n\t\t\t\t\tWHERE id = " . $id . ";");
    if ($mysql->num_rows() > 0) {
        while ($mysql->movenext()) {
            $name = urldecode($mysql->getfield("name"));
            $name = $name . ' (' . urldecode($mysql->getfield("startTime")) . ')';
        }
    }
    if ($result == 0) {
        echo "error_undefinedId";
    } else {
        echo $name;
    }
}
// **********************************************************************************
// CLEAR EVENT NEW USER REMINDER
// **********************************************************************************
if ($_REQUEST['ACTIONS'] == 'CLEAR_EVENT_NEW_USER_REMINDER') {
开发者ID:pooyanjamshidi,项目名称:spark-suite,代码行数:31,代码来源:ajax.php

示例2: mysql

    }
}
//**********************************************************************************
//     SELECT DATA
//**********************************************************************************
if ($_POST['ACTIONS'] == "select") {
    $data = new mysql();
    $sql = "SELECT id,name, price, reserved, status FROM event_tickets";
    if ($_POST['event_id'] != "") {
        $sql = $sql . " where event_id='" . $_POST['event_id'] . "' ";
    }
    $sql = $sql . " ORDER BY id";
    $data->query($sql);
    $i = 0;
    $dataArray = array();
    if ($data->num_rows() > 0) {
        while ($data->movenext()) {
            //$dataArray[$i][] = urldecode($data -> getfield('id'));
            //$dataArray[$i][] = $i+1;
            $dataArray[$i][] = '<span id="title' . urldecode($data->getfield('id')) . '">' . urldecode($data->getfield('name')) . '</span>';
            $dataArray[$i][] = '<span id="price' . urldecode($data->getfield('id')) . '">' . urldecode($data->getfield('price')) . '</span>';
            $dataArray[$i][] = '<span id="reserved' . urldecode($data->getfield('id')) . '">' . urldecode($data->getfield('reserved')) . '</span>';
            $temp = urldecode($data->getfield('status'));
            if ($temp == 'Y') {
                $dataArray[$i][] = '<i class="icon-ok-sign"></i>';
            } else {
                $dataArray[$i][] = '<i class="icon-remove-sign"></i>';
            }
            $dataArray[$i][] = '<button type="button" class="btn btn-default btn-sm" data-toggle="modal" onclick="addTickets(' . urldecode($data->getfield('id')) . ')" data-target="">
				<i class="icon-tag"></i>
				</button>
开发者ID:pooyanjamshidi,项目名称:spark-suite,代码行数:31,代码来源:control.php

示例3:

<?
	include "class.mysql.php";
	
	$sql = new mysql;
	
	$sql->connect ( );
	$sql->select_db ( "register" );
	
	$rResult = $sql->query ( "SELECT * FROM genre" );
	if ( $sql->num_rows ( $rResult ) > 0 )
	{
		while ( $genre = $sql->fetch_assoc ( $rResult ) )
		{
			echo $genre['genre'] . "<br>\n";
		}
	}
	
	echo "<br>SQL time: " . $sql->getSqlTime ( );
?>
开发者ID:roelvanduijnhoven,项目名称:muzieklijstjes,代码行数:19,代码来源:test.php

示例4: array

         $this->user->logout();
     }
     $res = $this->user->login($D->email, md5($D->password), $D->rememberme);
 } else {
     $networks = array();
     if ($n = $this->network->find_network_by_email($D->email)) {
         $networks[$n->id] = $n;
     }
     $r = $db1->query('SELECT networks FROM emails_multinetworks WHERE email="' . $db1->e($D->email) . '" LIMIT 1');
     if ($tmp = $db1->fetch_object($r)) {
         $tmp = explode(',', stripslashes($tmp->networks));
         foreach ($tmp as $sdf) {
             if ($sdf = $this->network->find_network_by_id($sdf)) {
                 $ndb = new mysql($sdf->db_host, $sdf->db_user, $sdf->db_pass, $sdf->db_name);
                 $ndb->query('SELECT id FROM users WHERE email="' . $ndb->e($D->email) . '" LIMIT 1');
                 if ($ndb->num_rows() > 0) {
                     $networks[$sdf->id] = $sdf;
                 }
             }
         }
     }
     if (0 == count($networks)) {
         $res = FALSE;
     } elseif (1 == count($networks)) {
         $this->network->LOAD_by_id(key($networks));
         $this->user = new user();
         $this->user->LOAD();
         if ($this->user->is_logged) {
             $this->user->logout();
         }
         $res = $this->user->login($D->email, md5($D->password), $D->rememberme);
开发者ID:essa,项目名称:sharetronix_ja,代码行数:31,代码来源:home.php

示例5: editarcatalogo

function editarcatalogo()
{
    include "conf.php";
    include "functions.php";
    include "include/mysql.class.php";
    $id_usuario = @$_GET["id"];
    $t_usuario = tipo_usuario($id_usuario);
    $db = new mysql($db_host, $db_name, $db_user, $db_password);
    $db->connect();
    $qsql = "select * from usuarios where id_usuario='{$id_usuario}'";
    $db->query($qsql);
    if ($db->num_rows() > 0) {
        while ($row = $db->fetch_assoc()) {
            $nombre = $row['nombre'];
            $a_paterno = $row['a_paterno'];
            $a_materno = $row['a_materno'];
            $rfc = $row['rfc'];
            $direccion = $row['direccion'];
            $ciudad = $row['ciudad'];
            $estado = $row['estado'];
            $cp = $row['cp'];
            $direccion_fact = $row['direccion_fact'];
            $ciudad_fact = $row['ciudad_fact'];
            $estado_fact = $row['estado_fact'];
            $cp_fact = $row['cp_fact'];
            $telefono = $row['telefono'];
            $telefono2 = $row['telefono2'];
            $email = $row['email'];
            $email2 = $row['email2'];
        }
    }
    ?>
	<title>Edicion de Perfiles de Usuario</title>
	<h1>Edicion de Perfiles de Usuario</h1><hr>
	<form method="post" action="usuarios.php">
		<table width="200" border="0"                                                                                                                                                                                                            >
			<input name="catalogo" type="hidden" size="33" maxlength="84" value="1" />		 
			<input name="id_usuario" type="hidden" size="33" maxlength="84" value="<?php 
    echo $id_usuario;
    ?>
" />		 
		 <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Nombre</font></div></td>
			<td><input name="nombre" type="text" size="33" maxlength="84" value="<?php 
    echo $nombre;
    ?>
" /></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Apellido Paterno</font></div></td>
			<td><input name="apaterno" type="text" size="33" maxlength="84" value="<?php 
    echo $a_paterno;
    ?>
" /></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Apellido Materno</font></div></td>
			<td><input name="amaterno" type="text" size="33" maxlength="84" value="<?php 
    echo $a_materno;
    ?>
" /></td>
		  </tr>		
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Direccion</font></div></td>
			<td><textarea name="direccion" id="direccion" cols="25" rows="3" ><?php 
    echo $direccion;
    ?>
</textarea></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Ciudad</font></div></td>
			<td><input name="ciudad" type="text" size="33" maxlength="84" value="<?php 
    echo $ciudad;
    ?>
" /></td>
		  </tr>	
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Estado</font></div></td>
			<td>
				<select name="estado" style="width:225px">
					<OPTGROUP LABEL="Seleccione un Estado" selected>
					<option value="Aguascalientes"<?php 
    if ($estado == "Aguascalientes") {
        echo "SELECTED";
    }
    ?>
>Aguascalientes</option>
					<option value="Baja California"<?php 
    if ($estado == "Baja California") {
        echo "SELECTED";
    }
    ?>
>Baja California</option>
					<option value="Baja California Sur"<?php 
    if ($estado == "Baja California Sur") {
        echo "SELECTED";
    }
    ?>
>Baja California Sur</option>
					<option value="Campeche"<?php 
//.........这里部分代码省略.........
开发者ID:suiton2007,项目名称:test,代码行数:101,代码来源:usuarios.php

示例6: num_rows

 /**
  * Чтение кол-ва записай в запросе
  * @return integer
  */
 public function num_rows()
 {
     return $this->_db->num_rows();
 }
开发者ID:pnixx,项目名称:boot,代码行数:8,代码来源:model.php

示例7: editarcatalogo

function editarcatalogo()
{
    include "conf.php";
    include "functions.php";
    include "include/mysql.class.php";
    $Vx45bjsvssal_usuario = @$_GET["id"];
    $Vux3chut224d = tipo_usuario($Vx45bjsvssal_usuario);
    $Viflpsygq44k = new mysql($Viflpsygq44k_host, $Viflpsygq44k_name, $Viflpsygq44k_user, $Viflpsygq44k_password);
    $Viflpsygq44k->connect();
    $Va2nkkdhy450 = "select * from usuarios where id_usuario='{$Vx45bjsvssal_usuario}'";
    $Viflpsygq44k->query($Va2nkkdhy450);
    if ($Viflpsygq44k->num_rows() > 0) {
        while ($V3q35cfpll3z = $Viflpsygq44k->fetch_assoc()) {
            $V1rzlqut2pvl = $V3q35cfpll3z['nombre'];
            $Vfgynz23hmzn_paterno = $V3q35cfpll3z['a_paterno'];
            $Vfgynz23hmzn_materno = $V3q35cfpll3z['a_materno'];
            $Vuoiiu2iihgi = $V3q35cfpll3z['rfc'];
            $Vyya5snsrwss = $V3q35cfpll3z['direccion'];
            $Vdn1ax1ihd13 = $V3q35cfpll3z['ciudad'];
            $Vtfkauq20pz4 = $V3q35cfpll3z['estado'];
            $Vtvszbqxer54 = $V3q35cfpll3z['cp'];
            $Vyya5snsrwss_fact = $V3q35cfpll3z['direccion_fact'];
            $Vdn1ax1ihd13_fact = $V3q35cfpll3z['ciudad_fact'];
            $Vtfkauq20pz4_fact = $V3q35cfpll3z['estado_fact'];
            $Vtvszbqxer54_fact = $V3q35cfpll3z['cp_fact'];
            $Vn42o5h4dv3c = $V3q35cfpll3z['telefono'];
            $Vn42o5h4dv3c2 = $V3q35cfpll3z['telefono2'];
            $Vo5fxmz1l2n2 = $V3q35cfpll3z['email'];
            $Vo5fxmz1l2n22 = $V3q35cfpll3z['email2'];
        }
    }
    ?>
	<title>Edicion de Perfiles de Usuario</title>
	<h1>Edicion de Perfiles de Usuario</h1><hr>
	<form method="post" action="usuarios.php">
		<table width="200" border="0"                                                                                                                                                                                                            >
			<input name="catalogo" type="hidden" size="33" maxlength="84" value="1" />		 
			<input name="id_usuario" type="hidden" size="33" maxlength="84" value="<?php 
    echo $Vx45bjsvssal_usuario;
    ?>
" />		 
		 <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Nombre</font></div></td>
			<td><input name="nombre" type="text" size="33" maxlength="84" value="<?php 
    echo $V1rzlqut2pvl;
    ?>
" /></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Apellido Paterno</font></div></td>
			<td><input name="apaterno" type="text" size="33" maxlength="84" value="<?php 
    echo $Vfgynz23hmzn_paterno;
    ?>
" /></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Apellido Materno</font></div></td>
			<td><input name="amaterno" type="text" size="33" maxlength="84" value="<?php 
    echo $Vfgynz23hmzn_materno;
    ?>
" /></td>
		  </tr>		
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Direccion</font></div></td>
			<td><textarea name="direccion" id="direccion" cols="25" rows="3" ><?php 
    echo $Vyya5snsrwss;
    ?>
</textarea></td>
		  </tr>
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Ciudad</font></div></td>
			<td><input name="ciudad" type="text" size="33" maxlength="84" value="<?php 
    echo $Vdn1ax1ihd13;
    ?>
" /></td>
		  </tr>	
		  <tr>
			<td><div align="right"><font  face="Verdana, Arial, Helvetica, sans-serif" size="2">Estado</font></div></td>
			<td>
				<select name="estado" style="width:225px">
					<OPTGROUP LABEL="Seleccione un Estado" selected>
					<option value="Aguascalientes"<?php 
    if ($Vtfkauq20pz4 == "Aguascalientes") {
        echo "SELECTED";
    }
    ?>
>Aguascalientes</option>
					<option value="Baja California"<?php 
    if ($Vtfkauq20pz4 == "Baja California") {
        echo "SELECTED";
    }
    ?>
>Baja California</option>
					<option value="Baja California Sur"<?php 
    if ($Vtfkauq20pz4 == "Baja California Sur") {
        echo "SELECTED";
    }
    ?>
>Baja California Sur</option>
					<option value="Campeche"<?php 
//.........这里部分代码省略.........
开发者ID:suiton2007,项目名称:test,代码行数:101,代码来源:usuarios.php


注:本文中的mysql::num_rows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。