Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

pdo getattribute function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php pdo getattribute () function

Write your php code

 
<?php ?>

Php Result


Your code below



(no version information, might be only in CVS)

PDO::getAttribute --  Retrieve a database connection attribute

Syntax

mixed PDO::getAttribute ( long attribute )

Warning

This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

This function returns the value of a database connection attribute. To retrieve PDOStatement attributes, refer to PDOStatement::getAttribute().

Note that some databases may not support all of the database connection attributes.

Parameters

attribute

One of the PDO_ATTR_* constants. The constants that apply to database connections are as follows:

PDO_ATTR_AUTOCOMMIT
PDO_ATTR_CASE
PDO_ATTR_CLIENT_VERSION
PDO_ATTR_CONNECTION_STATUS
PDO_ATTR_ERRMODE
PDO_ATTR_ORACLE_NULLS
PDO_ATTR_PERSISTENT
PDO_ATTR_PREFETCH
PDO_ATTR_SERVER_INFO
PDO_ATTR_SERVER_VERSION
PDO_ATTR_TIMEOUT

Return Values

A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.

Examples

Example 1. Retrieving database connection attributes

<?php
$conn
= new PDO('odbc:sample', 'db2inst1', 'ibmdb2');

print
"\nPDO_ATTR_AUTOCOMMIT: ";
print
$conn->getAttribute(PDO_ATTR_AUTOCOMMIT);

print
"\nPDO_ATTR_ERRMODE: ";
print
$conn->getAttribute(PDO_ATTR_ERRMODE);

print
"\nPDO_ATTR_CASE: ";
print
$conn->getAttribute(PDO_ATTR_CASE);

print
"\nPDO_ATTR_CLIENT_VERSION: ";
print
$conn->getAttribute(PDO_ATTR_CLIENT_VERSION);

print
"\nPDO_ATTR_CONNECTION_STATUS: ";
print
$conn->getAttribute(PDO_ATTR_CONNECTION_STATUS);

print
"\nPDO_ATTR_ORACLE_NULLS: ";
print
$conn->getAttribute(PDO_ATTR_ORACLE_NULLS);

print
"\nPDO_ATTR_PERSISTENT: ";
print
$conn->getAttribute(PDO_ATTR_PERSISTENT);

print
"\nPDO_ATTR_PREFETCH: ";
print
$conn->getAttribute(PDO_ATTR_PREFETCH);

print
"\nPDO_ATTR_SERVER_INFO: ";
print
$conn->getAttribute(PDO_ATTR_SERVER_INFO);

print
"\nPDO_ATTR_SERVER_VERSION: ";
print
$conn->getAttribute(PDO_ATTR_SERVER_VERSION);

print
"\nPDO_ATTR_TIMEOUT: ";
print
$conn->getAttribute(PDO_ATTR_TIMEOUT);
?>

See Also

PDO::setAttribute()
PDOStatement::getAttribute()
PDOStatement::setAttribute()

Php pdo getattribute Function syntax tag

pdo getattribute php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php pdo getattribute syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online