PHP Classes

DPManager: Build SQL queries from parameter values

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 244 This week: 1All time: 7,990 This week: 560Up
Version License PHP version Categories
dpmanager 1.9GNU General Publi...5.2.9PHP 5, Databases
Description 

Author

This class can build SQL queries from parameter values.

It can build and execute SQL INSERT, UPDATE and DELETE queries from parameters that define tables, field names and values and condition clauses.

The class can also execute SELECT queries to get all rows, get a single row or a single field of the results.

Picture of Isaac Trenado Mx
  Performance   Level  
Name: Isaac Trenado Mx is available for providing paid consulting. Contact Isaac Trenado Mx .
Classes: 7 packages by
Country: Mexico Mexico
Age: 37
All time rank: 211823 in Mexico Mexico
Week rank: 416 Up8 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php

/**
 * DropsizeMVCf - extension of the SlimFramework and others tools
 *
 * @author Isaac Trenado <isaac.trenado@codigolimpio.com>
 * @copyright 2013 Isaac Trenado
 * @link http://dropsize.codigolimpio.com
 * @license http://dropsize.codigolimpio.com/license.txt
 * @version 3.0.1
 * @package DropsizeMVCf
 *
 * DropsizeMVCf - Web publishing software
 * Copyright 2015 by the contributors
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * This program incorporates work covered by the following copyright and
 * permission notices:
 *
 * DropsizeMVCf is (c) 2013, 2015
 * Isaac Trenado - isaac.trenado@codigolimpio.com -
 * http://www.codigolimpio.com
 *
 * Wherever third party code has been used, credit has been given in the code's comments.
 *
 * DropsizeMVCf is released under the GPL
 *
 */
/**
 * Ejemplo 1 Interactura con DPManager
 *
 * @package com.dropsizemvcf
 * @author Isaac Trenado
 * @since 1.0.0
 */
include "./DPManager-Basic.php";

/**
 * Ejemplos
 *
 * buildDatosToUpdate Construye cadena CAMPO = '$valor', CAMPO = '$valor'
 * buildSelectQuery Construye cadena SELECT CAMPO, CAMPO FROM
 * TABLA WHERE CAMPO = '$cadena'
 * GROUP BY CAMPO ORDER BY CAMPO
 * buildDeleteQuery Construye cadena DELETE FROM TABLA WHERE CAMPO = '%cadena'
 * buildInsertQuery Construye cadena INSERT INTO TABLA (CAMPO, CAMPO) VALUES ('$cadena', '$cadena');
 * buildUpdateQuery Construye cadena UPDATE TABLA SET CAMPO = '%s', CAMPO = '%s'
 * WHERE CAMPO = '%s'
 *
 */

/**
 * Build Datos to update Query
 *
 * // Output : CAMPO1 = 'Valor 1' ,CAMPO2 = 'Valor 2' ,CAMPO3 = 'Valor 3'
 *
 */

$larFields = array();
$larFields['CAMPO1'] = " 'Valor 1' ";
$larFields['CAMPO2'] = " 'Valor 2' ";
$larFields['CAMPO3'] = " 'Valor 3' ";

$lstUpdateQuery = DPManager::buildDatosToUpdate($larFields);

echo
"<h1>Build Update Set Query</h1>";
echo
$lstUpdateQuery;

/**
 * Select Query Query Example 1
 * inicializando todos los parametros
 *
 * // Output : SELECT 'Valor 1' , 'Valor 2' , 'Valor 3' FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' LIMIT 0, 10
 *
 */

$lstSelectQuery = DPManager::buildSelectQuery(
               
implode(",", $larFields), "NOMBRE_TABLA", "CAMPO = 'cadena' ", false, false, false, "LIMIT 0, 10"
);

echo
"<h1>Build Simple Select from correct params</h1>";
echo
$lstSelectQuery;

/**
 * Select Query Query Example 2
 * con agrupamiento
 *
 * // Output : SELECT sum(CAMPO) FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' GROUP BY CAMPO
 *
 */

$lstSelectQuery2 = DPManager::buildSelectQuery(
               
"sum(CAMPO)", "NOMBRE_TABLA", "CAMPO = 'cadena' ", "CAMPO"
);

echo
"<h1>Build group Query From correct params</h1>";
echo
$lstSelectQuery2;

/**
 * Select Query Query Example 3
 * con Ordenamiento
 *
 * Output : SELECT 'Valor 1' , 'Valor 2' , 'Valor 3' FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' ORDER BY CAMPO DESC
 */

$lstSelectQuery3 = DPManager::buildSelectQuery(
               
implode(",", $larFields), "NOMBRE_TABLA", "CAMPO = 'cadena' ", false, "CAMPO", "DESC"
);

echo
"<h1>Build Simple Query From Order By Params</h1>";
echo
$lstSelectQuery3;

/**
 * DELETE Query Example 1
 *
 * Output : DELETE FROM NOMBRE_TABLA WHERE CAMPO = 'cadena'
 *
 */

$lstDeleteQuery1 = DPManager::buildDeleteQuery("NOMBRE_TABLA", "CAMPO = 'cadena' ");

echo
"<h1>Build Simple Delete Query From Params</h1>";
echo
$lstDeleteQuery1;

/**
 * INSERT Query Example 1
 *
 * Output : INSERT INTO NOMBRE_TABLA ( CAMPO1,CAMPO2,CAMPO3) VALUES ( 'Valor 1' , 'Valor 2' , 'Valor 3' )
 *
 */

$lstInsertQuery1 = DPManager::buildInsertQuery($larFields, "NOMBRE_TABLA");

echo
"<h1>Build Simple Insert Data From Params array type and table name</h1>";
echo
$lstInsertQuery1;

/**
 * UPDATE Query Example 1
 * Para este ejemplo, necesitamos construir el SET con DPManager::buildDatosToUpdate($larFields);
 *
 * Output : UPDATE NOMBRE_TABLA SET CAMPO1 = 'Valor 1' ,CAMPO2 = 'Valor 2' ,CAMPO3 = 'Valor 3' WHERE CAMPO = 'valor'
 *
 */

$lstUpdateQuery1 = DPManager::buildUpdateQuery("NOMBRE_TABLA", $lstUpdateQuery, "CAMPO = 'valor' ");

echo
"<h1>Build Simple Update From Params array type, table name and condition to affect rows</h1>";
echo
$lstUpdateQuery1;


/**
 * Poder iterar resultados de base de datos, Object u Array aplicando un metodo
 * de regreso
 * @param array
 */

$array = array(array(1, 2), array(3, 4));
$result = DPManager::iteraRecord($array, function() {

   
$row = func_get_args();
   
   
$uno = $row[0] . "UNO";
   
$dos = $row[1] . "DOS";

    return array(
$uno, $dos);
});

echo
"<h1>Aplicaci&oacute;n de m&eacute;todo anonimo a cada uno "
. "de los elementos del objeto o arreglo</h1>";
echo
"<pre>";
print_r($result);
echo
"</pre>";


Details

<pre style='color:#000000;background:#ffffff;'><span style='color:#5f5035; background:#ffffe8; '>&lt;?php</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* DropsizeMVCf - extension of the SlimFramework and others tools</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;*</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@author</span><span style='color:#3f5fbf; background:#ffffe8; '> Isaac Trenado </span><span style='color:#0000e6; background:#ffffe8; '>&lt;</span><span style='color:#7144c4; background:#ffffe8; '>isaac.trenado@codigolimpio.com</span><span style='color:#0000e6; background:#ffffe8; '>></span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@copyright</span><span style='color:#3f5fbf; background:#ffffe8; '> 2013 Isaac Trenado</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@link</span><span style='color:#3f5fbf; background:#ffffe8; '> </span><span style='color:#5555dd; background:#ffffe8; '>http://dropsize.codigolimpio.com</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@license</span><span style='color:#3f5fbf; background:#ffffe8; '> </span><span style='color:#5555dd; background:#ffffe8; '>http://dropsize.codigolimpio.com/license.txt</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@version</span><span style='color:#3f5fbf; background:#ffffe8; '> 3.0.1</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@package</span><span style='color:#3f5fbf; background:#ffffe8; '> DropsizeMVCf</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;*</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* DropsizeMVCf - Web publishing software</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Copyright 2015 by the contributors</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* This program is free software; you can redistribute it and/or modify</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* it under the terms of the GNU General Public License as published by</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* the Free Software Foundation; either version 2 of the License, or</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* (at your option) any later version.</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* This program is distributed in the hope that it will be useful,</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* GNU General Public License for more details.</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* You should have received a copy of the GNU General Public License</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* along with this program; if not, write to the Free Software</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* This program incorporates work covered by the following copyright and</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* permission notices:</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* DropsizeMVCf is (c) 2013, 2015 </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Isaac Trenado - </span><span style='color:#7144c4; background:#ffffe8; '>isaac.trenado@codigolimpio.com</span><span style='color:#3f5fbf; background:#ffffe8; '> -</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#5555dd; background:#ffffe8; '>http://www.codigolimpio.com</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Wherever third party code has been used, credit has been given in the code's comments.</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;*</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* DropsizeMVCf is released under the GPL</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Ejemplo 1 Interactura con DPManager</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@package</span><span style='color:#3f5fbf; background:#ffffe8; '> com.dropsizemvcf</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@author</span><span style='color:#3f5fbf; background:#ffffe8; '> Isaac Trenado</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@since</span><span style='color:#3f5fbf; background:#ffffe8; '> 1.0.0</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>include</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"./DPManager-Basic.php"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Ejemplos</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* buildDatosToUpdate Construye cadena CAMPO = '</span><span style='color:#797997; background:#ffffe8; '>$valor</span><span style='color:#3f5fbf; background:#ffffe8; '>', CAMPO = '</span><span style='color:#797997; background:#ffffe8; '>$valor</span><span style='color:#3f5fbf; background:#ffffe8; '>'</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* buildSelectQuery Construye cadena SELECT CAMPO, CAMPO FROM </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* TABLA WHERE CAMPO = '</span><span style='color:#797997; background:#ffffe8; '>$cadena</span><span style='color:#3f5fbf; background:#ffffe8; '>' </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* GROUP BY CAMPO ORDER BY CAMPO</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* buildDeleteQuery Construye cadena DELETE FROM TABLA WHERE CAMPO = '%cadena'</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* buildInsertQuery Construye cadena INSERT INTO TABLA (CAMPO, CAMPO) VALUES ('</span><span style='color:#797997; background:#ffffe8; '>$cadena</span><span style='color:#3f5fbf; background:#ffffe8; '>', '</span><span style='color:#797997; background:#ffffe8; '>$cadena</span><span style='color:#3f5fbf; background:#ffffe8; '>');</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* buildUpdateQuery Construye cadena UPDATE TABLA SET CAMPO = '%s', CAMPO = '%s'</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* WHERE CAMPO = '%s'</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Build Datos to update Query</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* // Output : CAMPO1 = 'Valor 1' ,CAMPO2 = 'Valor 2' ,CAMPO3 = 'Valor 3' </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>array</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>[</span><span style='color:#0000e6; background:#ffffe8; '>'CAMPO1'</span><span style='color:#808030; background:#ffffe8; '>]</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>" 'Valor 1' "</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>[</span><span style='color:#0000e6; background:#ffffe8; '>'CAMPO2'</span><span style='color:#808030; background:#ffffe8; '>]</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>" 'Valor 2' "</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>[</span><span style='color:#0000e6; background:#ffffe8; '>'CAMPO3'</span><span style='color:#808030; background:#ffffe8; '>]</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>" 'Valor 3' "</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstUpdateQuery</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildDatosToUpdate</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Update Set Query&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstUpdateQuery</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Select Query Query Example 1</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* inicializando todos los parametros</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* // Output : SELECT 'Valor 1' , 'Valor 2' , 'Valor 3' FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' LIMIT 0, 10</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstSelectQuery</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildSelectQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#400000; background:#ffffe8; '>implode</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#0000e6; background:#ffffe8; '>","</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO = 'cadena' "</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0f4d75; background:#ffffe8; '>false</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0f4d75; background:#ffffe8; '>false</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0f4d75; background:#ffffe8; '>false</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"LIMIT 0, 10"</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Simple Select from correct params&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstSelectQuery</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Select Query Query Example 2</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* con agrupamiento</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* // Output : SELECT sum(CAMPO) FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' GROUP BY CAMPO</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstSelectQuery2</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildSelectQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#0000e6; background:#ffffe8; '>"sum(CAMPO)"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO = 'cadena' "</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO"</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build group Query From correct params&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstSelectQuery2</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Select Query Query Example 3</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* con Ordenamiento</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Output : SELECT 'Valor 1' , 'Valor 2' , 'Valor 3' FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' ORDER BY CAMPO DESC</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstSelectQuery3</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildSelectQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#400000; background:#ffffe8; '>implode</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#0000e6; background:#ffffe8; '>","</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO = 'cadena' "</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0f4d75; background:#ffffe8; '>false</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"DESC"</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Simple Query From Order By Params&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstSelectQuery3</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* DELETE Query Example 1</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Output : DELETE FROM NOMBRE_TABLA WHERE CAMPO = 'cadena' </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstDeleteQuery1</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildDeleteQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO = 'cadena' "</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Simple Delete Query From Params&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstDeleteQuery1</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* INSERT Query Example 1</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Output : INSERT INTO NOMBRE_TABLA ( CAMPO1,CAMPO2,CAMPO3) VALUES ( 'Valor 1' , 'Valor 2' , 'Valor 3' )</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstInsertQuery1</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildInsertQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Simple Insert Data From Params array type and table name&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstInsertQuery1</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* UPDATE Query Example 1</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Para este ejemplo, necesitamos construir el SET con DPManager::buildDatosToUpdate(</span><span style='color:#797997; background:#ffffe8; '>$larFields</span><span style='color:#3f5fbf; background:#ffffe8; '>);</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Output : UPDATE NOMBRE_TABLA SET CAMPO1 = 'Valor 1' ,CAMPO2 = 'Valor 2' ,CAMPO3 = 'Valor 3' WHERE CAMPO = 'valor' </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$lstUpdateQuery1</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>buildUpdateQuery</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#0000e6; background:#ffffe8; '>"NOMBRE_TABLA"</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstUpdateQuery</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"CAMPO = 'valor' "</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Build Simple Update From Params array type, table name and condition to affect rows&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$lstUpdateQuery1</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#c0bd92; background:#ffffe8; '>/</span><span style='color:#3f5fbf; background:#ffffe8; '></span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* Poder iterar resultados de base de datos, Object u Array aplicando un metodo</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* de regreso</span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;* </span><span style='color:#005fd2; background:#ffffe8; '>@param</span><span style='color:#3f5fbf; background:#ffffe8; '> </span><span style='color:#bb7977; background:#ffffe8; '>array</span><span style='color:#3f5fbf; background:#ffffe8; '> </span> <span style='color:#3f5fbf; background:#ffffe8; '>&#xa0;</span><span style='color:#c0bd92; background:#ffffe8; '>*/</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$array</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>array</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>array</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#008c00; background:#ffffe8; '>1</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#008c00; background:#ffffe8; '>2</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>array</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#008c00; background:#ffffe8; '>3</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#008c00; background:#ffffe8; '>4</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#797997; background:#ffffe8; '>$result</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> DPManager</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#800080; background:#ffffe8; '>:</span><span style='color:#000000; background:#ffffe8; '>iteraRecord</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#797997; background:#ffffe8; '>$array</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>function</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800080; background:#ffffe8; '>{</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#797997; background:#ffffe8; '>$row</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#400000; background:#ffffe8; '>func_get_args</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;</span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#797997; background:#ffffe8; '>$uno</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$row</span><span style='color:#808030; background:#ffffe8; '>[</span><span style='color:#008c00; background:#ffffe8; '>0</span><span style='color:#808030; background:#ffffe8; '>]</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>.</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"UNO"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#797997; background:#ffffe8; '>$dos</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>=</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$row</span><span style='color:#808030; background:#ffffe8; '>[</span><span style='color:#008c00; background:#ffffe8; '>1</span><span style='color:#808030; background:#ffffe8; '>]</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#808030; background:#ffffe8; '>.</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"DOS"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '>&#xa0;&#xa0;&#xa0;&#xa0;</span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>return</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#800000; background:#ffffe8; font-weight:bold; '>array</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#797997; background:#ffffe8; '>$uno</span><span style='color:#808030; background:#ffffe8; '>,</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#797997; background:#ffffe8; '>$dos</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800080; background:#ffffe8; '>}</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;h1>Aplicaci&amp;oacute;n de m&amp;eacute;todo anonimo a cada uno "</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#808030; background:#ffffe8; '>.</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"de los elementos del objeto o arreglo&lt;/h1>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;pre>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#400000; background:#ffffe8; '>print_r</span><span style='color:#808030; background:#ffffe8; '>(</span><span style='color:#797997; background:#ffffe8; '>$result</span><span style='color:#808030; background:#ffffe8; '>)</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> <span style='color:#800000; background:#ffffe8; font-weight:bold; '>echo</span><span style='color:#000000; background:#ffffe8; '> </span><span style='color:#0000e6; background:#ffffe8; '>"&lt;/pre>"</span><span style='color:#800080; background:#ffffe8; '>;</span><span style='color:#000000; background:#ffffe8; '></span> </pre>


  Files folder image Files  
File Role Description
Accessible without login Plain text file basic.php Example Testing on your server
Plain text file DPManager-Basic.php Class Class Code To handler Querys
Accessible without login HTML file example-2.html Doc. Documentation
Accessible without login HTML file example.html Data Example y outputs, result to execute correctly basic.php file
Accessible without login HTML file log.html Doc. Documentation
Accessible without login Plain text file README.md Data Auxiliary data
Accessible without login Plain text file test.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:244
This week:1
All time:7,990
This week:560Up