PHP Classes

File: test/stored_procedure_test.php

Recommend this page to a friend!
  Classes of Hernádi Tamás   Rasher PHP Data Access Layer Helper - Database Repository   test/stored_procedure_test.php   Download  
File: test/stored_procedure_test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Rasher PHP Data Access Layer Helper - Database Repository
Run queries to access data in any type of database
Author: By
Last change:
Date: 1 year ago
Size: 912 bytes
 

Contents

Class file image Download
<?php
namespace Rasher\Test;
use
PDO;
use
Rasher\Data\DataManagement\{BindingParam};
use
Rasher\Data\PDO\DataManagement\{ConnectionData, DataAccessLayerHelper}; //PDO extension
use Rasher\Common\{Common};

include_once
__DIR__."/../src/data_type_helper.php";
include_once
__DIR__."/../src/data_access_layer_helper_base.php";
include_once
__DIR__."/../src/data_access_layer_helper_pdo.php";

$connectionData = new ConnectionData("sqlsrv:server=(local);Database=test","",""); //PDO MSSQL
$dal = new DataAccessLayerHelper($connectionData);

$query = "exec getUser ?, ?";
$params = array();
$params[] = new BindingParam("Id", PDO::PARAM_INT, null);
$params[] = new BindingParam("LoginName", PDO::PARAM_STR, "user_3");
$result = $dal->execute($query, $params);

var_dump($result);
echo
LINE_SEPARATOR;
echo
LINE_SEPARATOR;

//simple query
$query = "exec getUser";
$result = $dal->query($query);
var_dump($result);

?>