File: index.php

Recommend this page to a friend!
  Classes of Nahid Bin Azhar  >  Crudx  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Crudx
Store and retrieve objects in MySQL using MySQLi
Author: By
Last change: delete .DS_Store
update readme
fix configuration issue
Date: 4 years ago
Size: 757 bytes
 

 

Contents

Class file image Download
<?php
/*
*@Author: Nahid Bin Azhar
*@Author URL: http://nahid.co
*/

require_once 'src/Crudx.php';

use
Nahid\Crudx\Crudx;

//use Nahid\Crudx\Crudx;
$config = [
   
'host' => 'localhost',
   
'user' => 'root',
   
'password' => 'bolbona',
   
'database' => 'crudx_db',
   
'charset' => 'utf8',
   
'collation' => 'utf8_unicode_ci',
   
'prefix' => 'tbl_',
];

$db = new Crudx($config);

//Crudx::table('user')->where('id', '=', 5)->get()->result();

/*
$user = $db->table('userget()
$user->name = 'Arufur Naim';
$user->username = 'naim';
$user->created_at = date('Y-m-d');

if($user->save()) {
    echo 'Success';
}*/

echo '<pre>';
$query = $db->table('users')->where('username', '=', 'nahid')->first(['name'])->result();
var_dump($db->getQueryString());


For more information send a message to info at phpclasses dot org.