PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Mohammad Keramatifar   Easy PDO Simple Wrapper   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: usage example
Class: Easy PDO Simple Wrapper
PDO wrapper to execute common SQL queries
Author: By
Last change:
Date: 7 years ago
Size: 499 bytes
 

Contents

Class file image Download
<?php
require 'config.php';
require
'class.mrkfPDO.php';

$fullname = mrkfPDO::GetOne("SELECT fullname FROM users WHERE id = 1");
echo
$fullname;

$userInfo = mrkfPDO::GetRow("SELECT * FROM users WHERE id = 1");
print_r($userInfo);

$usersList = mrkfPDO::GetAll("SELECT * FROM users");
print_r($usersList[1]);
print_r($usersList[2]);

// Execute method for INSERT, UPDATE, DELETE
if(mrkfPDO::Execute("SQL INSERT, UPDATE or DELETE queryies"))
{
    echo
'success message';
}


?>