PHP Classes

DPManager Usability - DPManager package blog

Recommend this page to a friend!
  All package blogs All package blogs   DPManager DPManager   Blog DPManager package blog   RSS 1.0 feed RSS 2.0 feed   Blog DPManager Usability  
  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  

Author:

Viewers: 21

Last month viewers: 1

Package: DPManager

Este articulo te será de utilidad para comprender la manera como se utiliza la librería DPManager. Esta librería es la base de grandes proyectos.




Loaded Article

Manejador de Querys, Construye querys a partir de parámetros

Incluir o cargar la librería

include "./DPManager-Basic.php";

Crear arreglo asociativo

$cliente = array();

// Arreglo asociativo
$cliente['id_cliente'] = 1;
$cliente['nombre'] = "'Héctor'";
$cliente['paterno'] = "'Hérnandez'";
$cliente['materno'] = "'Rivera'";

DPManager::buildDatosToUpdate

$lstGetSetToUpdate = DPManager::buildDatosToUpdate($cliente);

Resultado

id_cliente = 1,nombre = 'Hétor',paterno = 'Hérnandez',materno = 'Rivera'

DPManager::buildUpdateQuery

$lstUpdateQuery = DPManager::buildUpdateQuery("tabla", $lstGetSetToUpdate, "id_cliente = 3");

Resultado

UPDATE tabla SET id_cliente = 1,nombre = 'Hétor',paterno = 'Hérnandez',materno = 'Rivera' WHERE id_cliente = 3

DPManager::buildInsertQuery

$lstInsertQuery = DPManager::buildInsertQuery($cliente, "tabla");

Resultado

INSERT INTO tabla ( id_cliente,nombre,paterno,materno) VALUES (1,'Hétor','Hérnandez','Rivera')

DPManager::buildSelectQuery

$lstSelectQuery = DPManager::buildSelectQuery("nombre, paterno, concat_ws(',', nombre, paterno) as completo"
                , "tabla", false, false
                , "nombre", "asc");

Resultado

SELECT nombre, paterno, concat_ws(',', nombre, paterno) as completo FROM tabla ORDER BY nombre asc

DPManager::buildDeleteQuery

$lstDeleteQuery = DPManager::buildDeleteQuery("tabla"
                , " id_cliente = 10");

Resultado

DELETE FROM tabla WHERE id_cliente = 10



You need to be a registered user or login to post a comment

1,616,107 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:



Comments:

No comments were submitted yet.



  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  
  All package blogs All package blogs   DPManager DPManager   Blog DPManager package blog   RSS 1.0 feed RSS 2.0 feed   Blog DPManager Usability