PDO(3) 1 PDO(3)The PDO classINTRODUCTION
Represents a connection between PHP and a database server.
CLASS SYNOPSIS
PDO
PDO
o public PDO::__construct (string $dsn, [string $username], [string $password], [array $options])
o public bool PDO::beginTransaction (void )
o public bool PDO::commit (void )
o public mixed PDO::errorCode (void )
o public array PDO::errorInfo (void )
o public int PDO::exec (string $statement)
o public mixed PDO::getAttribute (int $attribute)
o publicstatic array PDO::getAvailableDrivers (void )
o public bool PDO::inTransaction (void )
o public string PDO::lastInsertId NULL ([string $name])
o public PDOStatement PDO::prepare (string $statement, [array $driver_options = array()])
o public PDOStatement PDO::query (string $statement)
o public string PDO::quote (string $string, [int $parameter_type = PDO::PARAM_STR])
o public bool PDO::rollBack (void )
o public bool PDO::setAttribute (int $attribute, mixed $value)
PHP Documentation Group PDO(3)
Check Out this Related Man Page
PDO.GETATTRIBUTE(3) 1 PDO.GETATTRIBUTE(3)PDO ::getAttribute - Retrieve a database connection attribute
SYNOPSIS
public mixed PDO::getAttribute (int $attribute)
DESCRIPTION
This function returns the value of a database connection attribute. To retrieve PDOStatement attributes, refer to PDOStatement.getAt-
tribute(3).
Note that some database/driver combinations may not support all of the database connection attributes.
PARAMETERS
o $attribute
- One of the PDO::ATTR_* constants. The constants that apply to database connections are as follows:
o PDO::ATTR_AUTOCOMMIT
o PDO::ATTR_CASE
o PDO::ATTR_CLIENT_VERSION
o PDO::ATTR_CONNECTION_STATUS
o PDO::ATTR_DRIVER_NAME
o PDO::ATTR_ERRMODE
o PDO::ATTR_ORACLE_NULLS
o PDO::ATTR_PERSISTENT
o PDO::ATTR_PREFETCH
o PDO::ATTR_SERVER_INFO
o PDO::ATTR_SERVER_VERSION
o 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');
$attributes = array(
"AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS",
"ORACLE_NULLS", "PERSISTENT", "PREFETCH", "SERVER_INFO", "SERVER_VERSION",
"TIMEOUT"
);
foreach ($attributes as $val) {
echo "PDO::ATTR_$val: ";
echo $conn->getAttribute(constant("PDO::ATTR_$val")) . "
";
}
?>
SEE ALSO PDO.setAttribute(3), PDOStatement.getAttribute(3), PDOStatement.setAttribute(3).
PHP Documentation Group PDO.GETATTRIBUTE(3)
I have a dropdown menu built in perl tk (I am using active state perl). I want to select a value from the dropdown menu and I want to be able to perform some other actions depending upon what value is selected. I have all the graphical part made but I dont know how to get the selected value. Any... (0 Replies)
My roommate forgot his admin password on his MacBook air..
He doesn't have the external SuperDrive, so we have no way of using the simple method of using the install disks and resetting the password..
The worst part is, he did this same thing about a year ago lol
At the time, we booted... (0 Replies)
I have a string
str="<option>win2</option><option>hp</option><option>lin</option>"
I have to arrange these in sorted order i.e
<option>hp</option><option>lin</option><option>win</option>
Can it be done by sort...?
Thanks for help (0 Replies)