PHP Classes

File: examples.php

Recommend this page to a friend!
  Classes of Mohamed Elbahja   The PDM   examples.php   Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: Example script
Class: The PDM
Run queries and manage tables with PDO or MySQLi
Author: By
Last change: Update examples.php
Date: 7 years ago
Size: 896 bytes
 

Contents

Class file image Download
<?php

require_once(dirname(__FILE__) . '/autoload.php');

/**
 * Start PDM Object
 * @var
 */
$pdm = PDM\PDM::getInstance();

/**
 * Load Command
 * @var oject
 */
$dml = pdm->load('DML', 'Database1');

/** start connection **/
$dml->start();

/**
 * Select DATA
 * table name is : prefix_users
 */
$users = $dml->getUsers();

/** table : prefix_pages **/
$pages = $dml->getPages();


/** Left Join **/
//$data = $dml->select('@prefix_tableName.id, @prefix_tableNameTwo.user', 'tableName', 'LEFT JOIN @prefix_tableNameTwo ON @prefix_tableName.id=@prefix_tableNameTwo.uid');


/** DDL **/
$ddl = $pdm->load('DDL', 'Database1');
$ddl->start();

$c = $ddl->create('tableName', '(id int NOT NULL PRIMARY KEY,
    name varchar(122) COLLATE @charset_general_ci NOT NULL,
    username varchar(50) COLLATE @charset_general_ci NOT NULL);'
)); // @charset = default charset in config file

var_dump($c);