PHP Classes

File: example/test.php

Recommend this page to a friend!
  Classes of SzpaQ   App PHP Model Class   example/test.php   Download  
File: example/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: App PHP Model Class
Map object variables to database table records
Author: By
Last change:
Date: 2 years ago
Size: 884 bytes
 

Contents

Class file image Download
<?php

/**
 *
 * LICENCE
 * ALL RIGHTS RESERVED.
 * YOU ARE NOT ALLOWED TO COPY/EDIT/SHARE/WHATEVER.
 * IN CASE OF ANY PROBLEM CONTACT AUTHOR.
 * @author ?ukasz Szpak (szpaaaaq@gmail.com)
 * @Copyright 2018 SzpaQ
 * @license ALL RIGHTS RESERVED
 *
 * * */

include 'loader.php';
$pdo = new PDO('mysql:dbname=dev_bot;host=localhost;charset=utf8', 'master', '12dsfgNJKGH&34');
App\Model::_setDB($pdo);
App\Model::setPrefix('app_');
$user = new Users(27);

echo
$user->username;
var_dump($user->getContacts(array('order' => 'contact_id DESC')));



/** Create new User */
/* $user = new Users;
    $user->email = "szpaaaaq@gmail.com";
    $user->password = md5('salt_string2357111317192329374357:szpaaaaq@gmail.com');
    $user->username = 'SzpaQ';
    $user->role_id = 1;
    $user->save();
*/
/** find One user */
// Users::findFirst(array('user_id = :uid', 'bind'=>array('uid' => 1)));