TwistPHP Documentation

connect

File path: dist/twist/Core/Models/Database/ProtocolPDO.model.php
Namespace: Twist\Core\Models\Database
Extends:

connectThe library of PDO, this will allow the Database class to
communicate with a MySQL server using the advanced PDO Protocol

Parameters

Name Type Description
$strServerstringn/a
$strUsernamestringn/a
$strPasswordstringn/a
$strDatabasestringn/a
[$intPort = 3306]integern/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$strServer 'foo';
$strUsername 'foo';
$strPassword 'foo';
$strDatabase 'foo';
$intPort 3306;

//Call the function connect with the example vars
$resProtocolPDO = new \Twist\Core\Models\Database\ProtocolPDO();
$resProtocolPDO -> connect($strServer$strUsername$strPassword$strDatabase$intPort);