SlideShare a Scribd company logo
1 of 42
PHP, PHP FRAMEWORKS AND DATABASE
Sayed Ahmed
Computer Engineering, BUET, Bangladesh
MSC, Computer Science, U of Manitoba, Canada
http://www.JustEtc.net
http://sayed.justetc.net
sayed@justetc.net
TOPICS
οƒ’ Connection strategies
οƒ’ Configuration for connection in different
frameworks
οƒ’ PHP and DB2, MSSQL Server
οƒ’ Common database oriented operations
οƒ’ Reference to DB oriented functions/classes
CONNECTION
οƒ’ mysql_connect
οƒ’ mysqli_connect
οƒ’ PDO
 PDO_ODBC
οƒ’ Connection from Frameworks
 Code Igniter – configure for db connection
 CakePHP - configure for db connection
 Zend - configure for db connection
PDO VS MYSQLI
οƒ’ Overall, PDO is a better choice than mysqli
οƒ’ However, if performance is the only issue
that you care, and
 mysql will be the backend database all the
time,
 you can use mysqli
οƒ’ Reference:
 http://net.tutsplus.com/tutorials/php/pdo-vs-
mysqli-which-should-you-use/
MYSQL_CONNECT
οƒ’ mysql_connect
 Opens a connection to a MySQL Server
 Deprecated as of PHP 5.5.0, and will be removed in
the future.
 Instead use MySQLi or PDO_MySQL
 mysql_connect examples
MYSQL_CONNECT EXAMPLES USING PORTS
MYSQL_CONNECT USING PATH TO
SOCKET
MYSQLI_CONNECT β€” ALIAS OF MYSQLI::__CONSTRUCT()
MYSQLI_CONNECT
MYSQLI_CONNECT (OBJECT EXAMPLE)
OBJECT ORIENTED STYLE CONNECTION WITH MYSQLI
DATABASE CONNECTION WITH PDO
PDO CONNECTION WHEN PARAMETERS IN A FILE
PDO USING PHP.INI CONFIGURATIONS
CODE IGNITER DATABASE CONFIGURATION
οƒ’ application/config/database.php
 $db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$db['default']['swap_pre'] = "";
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
οƒ’ Reference:
 http://ellislab.com/codeigniter/user-guide/database/configuration.html
CAKEPHP AND MYSQL
οƒ’ A copy of CakePHP’s database configuration
file is found in
 /app/Config/database.php.default
οƒ’ Make a copy of this file in the same directory,
but name it
 database.php
οƒ’ Change database.php as follows
CAKEPHP AND MYSQL
ZEND AND DATABASE CONFIGURATION
οƒ’ Zend_Config_Ini enables developers to store
configuration data in a familiar INI format
PDO AND PREPARED STATEMENTS
PDO FETCH AND PREPARED STMT
PDO AND STORED PROCEDURE (OUT
PARAM)
PDO STRD PROC WITH IN/OUT PARAMS
MYSQLI AND STORED PROCEDURE
MYSQLI FETCHING RESULTS FROM STORED PROCEDURES
PHP FUNCTIONS FOR SQL SERVER
οƒ’ The name of the functions may closely resemble the functionality.
 # mssql_ bind
# mssql_ close
# mssql_ connect
# mssql_ data_ seek
# mssql_ execute
# mssql_ fetch_ array
# mssql_ fetch_ assoc
# mssql_ fetch_ batch
# mssql_ fetch_ field
# mssql_ fetch_ object
# mssql_ fetch_ row
# mssql_ field_ length
# mssql_ field_ name
# mssql_ field_ seek
# mssql_ field_ type
# mssql_ free_ result
# mssql_ free_ statement
PHP FUNCTIONS FOR SQL SERVER
οƒ’ # mssql_ get_ last_ message
# mssql_ guid_ string
# mssql_ init
# mssql_ min_ error_ severity
# mssql_ min_ message_ severity
# mssql_ next_ result
# mssql_ num_ fields
# mssql_ num_ rows
# mssql_ pconnect
# mssql_ query
# mssql_ result
# mssql_ rows_ affected
# mssql_ select_ db
PHP AND IBM DB2
οƒ’ PHP has concepts like PDO and PDO_ODBC, and
generic odbc features that will allow you to connect to and
work with DB-2 databases. Generic odbc is the
general/procedural way to connect to. PDO and
PDO_ODBC are object oriented ways. PDO works with
native IBM drivers. PDO_ODBC uses odbc connections
to the DB2. For PHP you need to install drivers to support
DB2. I worked with PDO_ODBC to connect to DB-2
databases in IBM iSeries servers. You need to install
odbc db2 drivers for iseries servers. Then in
/etc/odbcinst.ini file you need to mention driver
specifications and in /etc/odbc.ini, you need to mention
the odbc dsn name, database name, and some other
parameters to connect to the database. Though, you may
also supply some parameters in the PDO_ODBC connect
method.
PHP AND SQL SERVER STORED PROCEDURE
PHP AND SQL SERVER STORED PROCEDURE
MYSQL RELATED FUNCTIONS
MYSQL RELATED FUNCTIONS
MYSQL RELATED FUNCTIONS
MYSQLI β€” THE MYSQLI CLASS
οƒ’ mysqli::$affected_rows β€” Gets the number of affected
rows in a previous MySQL operation
οƒ’ mysqli::autocommit β€” Turns on or off auto-committing
database modifications
οƒ’ mysqli::begin_transaction β€” Starts a transaction
οƒ’ mysqli::change_user β€” Changes the user of the specified
database connection
οƒ’ mysqli::character_set_name β€” Returns the default
character set for the database connection
οƒ’ mysqli::$client_info β€” Get MySQL client info
οƒ’ mysqli::$client_version β€” Returns the MySQL client
version as a stringmysqli::close β€” Closes a previously
opened database connection
MYSQLI β€” THE MYSQLI CLASS
οƒ’ mysqli::commit β€” Commits the current transaction
οƒ’ mysqli::$connect_errno β€” Returns the error code from
last connect call
οƒ’ mysqli::$connect_error β€” Returns a string description of
the last connect error
οƒ’ mysqli::__construct β€” Open a new connection to the
MySQL server
οƒ’ mysqli::debug β€” Performs debugging operations
οƒ’ mysqli::dump_debug_info β€” Dump debugging
information into the log
οƒ’ mysqli::$errno β€” Returns the error code for the most
recent function call
MYSQLI β€” THE MYSQLI CLASS
οƒ’ mysqli::$error_list β€” Returns a list of errors from the last command executed
οƒ’ mysqli::$error β€” Returns a string description of the last error
οƒ’ mysqli::$field_count β€” Returns the number of columns for the most recent query
οƒ’ mysqli::get_charset β€” Returns a character set objectmysqli::get_client_info β€”
Get MySQL client info
οƒ’ mysqli_get_client_stats β€” Returns client per-process statistics
οƒ’ mysqli_get_client_version β€” Returns the MySQL client version as an integer
οƒ’ mysqli::get_connection_stats β€” Returns statistics about the client connection
οƒ’ mysqli::$host_info β€” Returns a string representing the type of connection used
οƒ’ mysqli::$protocol_version β€” Returns the version of the MySQL protocol used
οƒ’ mysqli::$server_info β€” Returns the version of the MySQL server
οƒ’ mysqli::$server_version β€” Returns the version of the MySQL server as an
integer
οƒ’ mysqli::get_warnings β€” Get result of SHOW WARNINGS
MYSQLI β€” THE MYSQLI CLASS
οƒ’ mysqli::$info β€” Retrieves information about the most recently
executed querymysqli::init β€” Initializes MySQLi and returns a
resource for use with mysqli_real_connect()mysqli::$insert_id β€”
Returns the auto generated id used in the last querymysqli::kill β€”
Asks the server to kill a MySQL threadmysqli::more_results β€”
Check if there are any more query results from a multi
querymysqli::multi_query β€” Performs a query on the
databasemysqli::next_result β€” Prepare next result from
multi_querymysqli::options β€” Set optionsmysqli::ping β€” Pings a
server connection, or tries to reconnect if the connection has
gone downmysqli::poll β€” Poll connectionsmysqli::prepare β€”
Prepare an SQL statement for executionmysqli::query β€”
Performs a query on the databasemysqli::real_connect β€” Opens
a connection to a mysql servermysqli::real_escape_string β€”
Escapes special characters in a string for use in an SQL
statement, taking into account the current charset of the
connectionmysqli::real_query β€” Execute an SQL query
MYSQLI_STMT β€” THE MYSQLI_STMT CLASS
οƒ’ mysqli_stmt::$affected_rows β€” Returns the total number
of rows changed, deleted, or inserted by the last executed
statementmysqli_stmt::attr_get β€” Used to get the current
value of a statement attributemysqli_stmt::attr_set β€”
Used to modify the behavior of a prepared
statementmysqli_stmt::bind_param β€” Binds variables to
a prepared statement as
parametersmysqli_stmt::bind_result β€” Binds variables to
a prepared statement for result storagemysqli_stmt::close
β€” Closes a prepared statementmysqli_stmt::data_seek
β€” Seeks to an arbitrary row in statement result
setmysqli_stmt::$errno β€” Returns the error code for the
most recent statement callmysqli_stmt::$error_list β€”
Returns a list of errors from the last statement executed
MYSQLI_RESULT β€” THE MYSQLI_RESULT CLASS
οƒ’ mysqli_result::$current_field β€” Get current field offset of a result
pointermysqli_result::data_seek β€” Adjusts the result pointer to an
arbitrary row in the resultmysqli_result::fetch_all β€” Fetches all
result rows as an associative array, a numeric array, or
bothmysqli_result::fetch_array β€” Fetch a result row as an
associative, a numeric array, or bothmysqli_result::fetch_assoc β€”
Fetch a result row as an associative
arraymysqli_result::fetch_field_direct β€” Fetch meta-data for a
single fieldmysqli_result::fetch_field β€” Returns the next field in
the result setmysqli_result::fetch_fields β€” Returns an array of
objects representing the fields in a result
setmysqli_result::fetch_object β€” Returns the current row of a
result set as an objectmysqli_result::fetch_row β€” Get a result row
as an enumerated array
MYSQLI_DRIVER, MYSQLI_WARNING
οƒ’ mysqli_driver β€” The mysqli_driver
classmysqli_driver::embedded_server_end β€” Stop
embedded server
οƒ’ mysqli_driver::embedded_server_start β€” Initialize
and start embedded server
οƒ’ mysqli_driver::$report_mode β€” Enables or disables
internal report functions
οƒ’ mysqli_warning β€” The mysqli_warning
classmysqli_warning::__construct β€” The __construct
purpose
οƒ’ mysqli_warning::next β€” The next purpose
οƒ’ mysqli_sql_exception β€” The mysqli_sql_exception
class
PDO β€” THE PDO CLASS
οƒ’ PDO::beginTransaction β€” Initiates a
transactionPDO::commit β€” Commits a
transactionPDO::__construct β€” Creates a PDO
instance representing a connection to a
databasePDO::errorCode β€” Fetch the
SQLSTATE associated with the last operation
on the database handlePDO::errorInfo β€” Fetch
extended error information associated with the
last operation on the database
handlePDO::exec β€” Execute an SQL statement
and return the number of affected
rowsPDO::getAttribute β€” Retrieve a database
connection attribute
PDOSTATEMENT β€” THE PDOSTATEMENT CLASS
οƒ’ PDOStatement::bindColumn β€” Bind a column to a PHP
variablePDOStatement::bindParam β€” Binds a parameter
to the specified variable namePDOStatement::bindValue
β€” Binds a value to a
parameterPDOStatement::closeCursor β€” Closes the
cursor, enabling the statement to be executed
again.PDOStatement::columnCount β€” Returns the
number of columns in the result
setPDOStatement::debugDumpParams β€” Dump an SQL
prepared commandPDOStatement::errorCode β€” Fetch
the SQLSTATE associated with the last operation on the
statement handlePDOStatement::errorInfo β€” Fetch
extended error information associated with the last
operation on the statement handle
PDOEXCEPTION, MISC
οƒ’ PDOException β€” The PDOException class
οƒ’ PDO DriversCUBRID (PDO) β€” CUBRID
Functions (PDO_CUBRID)
οƒ’ MS SQL Server (PDO) β€” Microsoft SQL
Server and Sybase Functions (PDO_DBLIB)
οƒ’ Firebird/Interbase (PDO) β€”
Firebird/Interbase Functions
(PDO_FIREBIRD)
οƒ’ IBM (PDO) β€” IBM Functions (PDO_IBM)

More Related Content

What's hot

Php mysql connectivity
Php mysql connectivityPhp mysql connectivity
Php mysql connectivityabhikwb
Β 
PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part IIFirdaus Adib
Β 
Database presentation
Database presentationDatabase presentation
Database presentationwebhostingguy
Β 
Using php with my sql
Using php with my sqlUsing php with my sql
Using php with my sqlsalissal
Β 
Php Data Objects
Php Data ObjectsPhp Data Objects
Php Data Objectshiren.joshi
Β 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQLNicole Ryan
Β 
Mysql
MysqlMysql
Mysqllotlot
Β 
Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2ADARSH BHATT
Β 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06Terry Yoast
Β 
Stored Procedure
Stored ProcedureStored Procedure
Stored ProcedureNidiaRamirez07
Β 
9780538745840 ppt ch08
9780538745840 ppt ch089780538745840 ppt ch08
9780538745840 ppt ch08Terry Yoast
Β 

What's hot (17)

Php mysql connectivity
Php mysql connectivityPhp mysql connectivity
Php mysql connectivity
Β 
PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part II
Β 
PHP with MySQL
PHP with MySQLPHP with MySQL
PHP with MySQL
Β 
Database presentation
Database presentationDatabase presentation
Database presentation
Β 
Using php with my sql
Using php with my sqlUsing php with my sql
Using php with my sql
Β 
Php Data Objects
Php Data ObjectsPhp Data Objects
Php Data Objects
Β 
MySQL
MySQLMySQL
MySQL
Β 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
Β 
Mysql
MysqlMysql
Mysql
Β 
lab56_db
lab56_dblab56_db
lab56_db
Β 
Sqlite perl
Sqlite perlSqlite perl
Sqlite perl
Β 
Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2
Β 
veracruz
veracruzveracruz
veracruz
Β 
Mysql & Php
Mysql & PhpMysql & Php
Mysql & Php
Β 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06
Β 
Stored Procedure
Stored ProcedureStored Procedure
Stored Procedure
Β 
9780538745840 ppt ch08
9780538745840 ppt ch089780538745840 ppt ch08
9780538745840 ppt ch08
Β 

Viewers also liked

Http only cookie
Http only cookieHttp only cookie
Http only cookiefool2fish
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsSukrit Gupta
Β 
PHP - PDO Objects
PHP - PDO ObjectsPHP - PDO Objects
PHP - PDO ObjectsAJINKYA N
Β 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web CacheProdigyView
Β 
PHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationPHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationGerard Sychay
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsUdaAs PaNchi
Β 
Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookieswww.netgains.org
Β 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data ObjectsWez Furlong
Β 
Cookie and session
Cookie and sessionCookie and session
Cookie and sessionAashish Ghale
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsLena Petsenchuk
Β 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpointguested929b
Β 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare pptMandy Suzanne
Β 

Viewers also liked (14)

Http only cookie
Http only cookieHttp only cookie
Http only cookie
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
Β 
PHP - PDO Objects
PHP - PDO ObjectsPHP - PDO Objects
PHP - PDO Objects
Β 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
Β 
Cookies & Session
Cookies & SessionCookies & Session
Cookies & Session
Β 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
Β 
PHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationPHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and Authentication
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
Β 
Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookies
Β 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
Β 
Cookie and session
Cookie and sessionCookie and session
Cookie and session
Β 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
Β 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpoint
Β 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
Β 

Similar to Php and database functionality

20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnddo_aki
Β 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionjulien pauli
Β 
Php and MySQL Web Development
Php and MySQL Web DevelopmentPhp and MySQL Web Development
Php and MySQL Web Developmentw3ondemand
Β 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For BeginnersPriti Solanki
Β 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Chris Barber
Β 
Mysql connection
Mysql connectionMysql connection
Mysql connectionbeben benzy
Β 
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxModule 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxmoirarandell
Β 
Web app development_crud_13
Web app development_crud_13Web app development_crud_13
Web app development_crud_13Hassen Poreya
Β 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connectionLearnbay Datascience
Β 
Collection of built in functions for manipulating MySQL databases.docx
Collection of built in functions for manipulating MySQL databases.docxCollection of built in functions for manipulating MySQL databases.docx
Collection of built in functions for manipulating MySQL databases.docxKingKhaliilHayat
Β 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26SynapseindiaComplaints
Β 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5John Coggeshall
Β 
Interface python with sql database.pdf
Interface python with sql database.pdfInterface python with sql database.pdf
Interface python with sql database.pdfMohammadImran709594
Β 

Similar to Php and database functionality (20)

20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnd
Β 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
Β 
Php and MySQL Web Development
Php and MySQL Web DevelopmentPhp and MySQL Web Development
Php and MySQL Web Development
Β 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For Beginners
Β 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)
Β 
PHP and Mysql
PHP and MysqlPHP and Mysql
PHP and Mysql
Β 
Mysql connection
Mysql connectionMysql connection
Mysql connection
Β 
Db function
Db functionDb function
Db function
Β 
Php verses my sql
Php verses my sqlPhp verses my sql
Php verses my sql
Β 
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxModule 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Β 
Php verses MySQL
Php verses MySQLPhp verses MySQL
Php verses MySQL
Β 
Php verses MySQL
Php verses MySQLPhp verses MySQL
Php verses MySQL
Β 
Web app development_crud_13
Web app development_crud_13Web app development_crud_13
Web app development_crud_13
Β 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
Β 
Collection of built in functions for manipulating MySQL databases.docx
Collection of built in functions for manipulating MySQL databases.docxCollection of built in functions for manipulating MySQL databases.docx
Collection of built in functions for manipulating MySQL databases.docx
Β 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26
Β 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5
Β 
Php mysql
Php mysqlPhp mysql
Php mysql
Β 
PHP - Intriduction to MySQL And PHP
PHP - Intriduction to MySQL And PHPPHP - Intriduction to MySQL And PHP
PHP - Intriduction to MySQL And PHP
Β 
Interface python with sql database.pdf
Interface python with sql database.pdfInterface python with sql database.pdf
Interface python with sql database.pdf
Β 

More from Sayed Ahmed

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsSayed Ahmed
Β 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commandsSayed Ahmed
Β 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic frameworkSayed Ahmed
Β 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSayed Ahmed
Β 
Invest wisely
Invest wiselyInvest wisely
Invest wiselySayed Ahmed
Β 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction toSayed Ahmed
Β 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overviewSayed Ahmed
Β 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend frameworkSayed Ahmed
Β 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3Sayed Ahmed
Β 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2Sayed Ahmed
Β 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_htmlSayed Ahmed
Β 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcutsSayed Ahmed
Β 
Virtualization
VirtualizationVirtualization
VirtualizationSayed Ahmed
Β 
User interfaces
User interfacesUser interfaces
User interfacesSayed Ahmed
Β 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfonySayed Ahmed
Β 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayedSayed Ahmed
Β 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_designSayed Ahmed
Β 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrativeSayed Ahmed
Β 

More from Sayed Ahmed (20)

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
Β 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
Β 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
Β 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
Β 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
Β 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
Β 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
Β 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
Β 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
Β 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
Β 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
Β 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
Β 
Virtualization
VirtualizationVirtualization
Virtualization
Β 
User interfaces
User interfacesUser interfaces
User interfaces
Β 
Unreal
UnrealUnreal
Unreal
Β 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
Β 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
Β 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
Β 
Symfony 2
Symfony 2Symfony 2
Symfony 2
Β 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
Β 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
Β 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Β 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
Β 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
Β 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
Β 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
Β 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
Β 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
Β 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
Β 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
Β 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
Β 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
Β 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
Β 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
Β 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
Β 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
Β 
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | DelhiFULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhisoniya singh
Β 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
Β 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
Β 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Β 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Β 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Β 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Β 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Β 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Β 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Β 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
Β 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Β 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Β 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Β 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
Β 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Β 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Β 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Β 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
Β 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Β 
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | DelhiFULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY πŸ” 8264348440 πŸ” Call Girls in Diplomatic Enclave | Delhi
Β 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
Β 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Β 

Php and database functionality

  • 1. PHP, PHP FRAMEWORKS AND DATABASE Sayed Ahmed Computer Engineering, BUET, Bangladesh MSC, Computer Science, U of Manitoba, Canada http://www.JustEtc.net http://sayed.justetc.net sayed@justetc.net
  • 2. TOPICS οƒ’ Connection strategies οƒ’ Configuration for connection in different frameworks οƒ’ PHP and DB2, MSSQL Server οƒ’ Common database oriented operations οƒ’ Reference to DB oriented functions/classes
  • 3. CONNECTION οƒ’ mysql_connect οƒ’ mysqli_connect οƒ’ PDO  PDO_ODBC οƒ’ Connection from Frameworks  Code Igniter – configure for db connection  CakePHP - configure for db connection  Zend - configure for db connection
  • 4. PDO VS MYSQLI οƒ’ Overall, PDO is a better choice than mysqli οƒ’ However, if performance is the only issue that you care, and  mysql will be the backend database all the time,  you can use mysqli οƒ’ Reference:  http://net.tutsplus.com/tutorials/php/pdo-vs- mysqli-which-should-you-use/
  • 5. MYSQL_CONNECT οƒ’ mysql_connect  Opens a connection to a MySQL Server  Deprecated as of PHP 5.5.0, and will be removed in the future.  Instead use MySQLi or PDO_MySQL  mysql_connect examples
  • 8. MYSQLI_CONNECT β€” ALIAS OF MYSQLI::__CONSTRUCT()
  • 11. OBJECT ORIENTED STYLE CONNECTION WITH MYSQLI
  • 13. PDO CONNECTION WHEN PARAMETERS IN A FILE
  • 14. PDO USING PHP.INI CONFIGURATIONS
  • 15. CODE IGNITER DATABASE CONFIGURATION οƒ’ application/config/database.php  $db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; $db['default']['password'] = ""; $db['default']['database'] = "database_name"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = FALSE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; $db['default']['swap_pre'] = ""; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; οƒ’ Reference:  http://ellislab.com/codeigniter/user-guide/database/configuration.html
  • 16. CAKEPHP AND MYSQL οƒ’ A copy of CakePHP’s database configuration file is found in  /app/Config/database.php.default οƒ’ Make a copy of this file in the same directory, but name it  database.php οƒ’ Change database.php as follows
  • 18. ZEND AND DATABASE CONFIGURATION οƒ’ Zend_Config_Ini enables developers to store configuration data in a familiar INI format
  • 19. PDO AND PREPARED STATEMENTS
  • 20. PDO FETCH AND PREPARED STMT
  • 21. PDO AND STORED PROCEDURE (OUT PARAM)
  • 22. PDO STRD PROC WITH IN/OUT PARAMS
  • 23. MYSQLI AND STORED PROCEDURE
  • 24. MYSQLI FETCHING RESULTS FROM STORED PROCEDURES
  • 25. PHP FUNCTIONS FOR SQL SERVER οƒ’ The name of the functions may closely resemble the functionality.  # mssql_ bind # mssql_ close # mssql_ connect # mssql_ data_ seek # mssql_ execute # mssql_ fetch_ array # mssql_ fetch_ assoc # mssql_ fetch_ batch # mssql_ fetch_ field # mssql_ fetch_ object # mssql_ fetch_ row # mssql_ field_ length # mssql_ field_ name # mssql_ field_ seek # mssql_ field_ type # mssql_ free_ result # mssql_ free_ statement
  • 26. PHP FUNCTIONS FOR SQL SERVER οƒ’ # mssql_ get_ last_ message # mssql_ guid_ string # mssql_ init # mssql_ min_ error_ severity # mssql_ min_ message_ severity # mssql_ next_ result # mssql_ num_ fields # mssql_ num_ rows # mssql_ pconnect # mssql_ query # mssql_ result # mssql_ rows_ affected # mssql_ select_ db
  • 27. PHP AND IBM DB2 οƒ’ PHP has concepts like PDO and PDO_ODBC, and generic odbc features that will allow you to connect to and work with DB-2 databases. Generic odbc is the general/procedural way to connect to. PDO and PDO_ODBC are object oriented ways. PDO works with native IBM drivers. PDO_ODBC uses odbc connections to the DB2. For PHP you need to install drivers to support DB2. I worked with PDO_ODBC to connect to DB-2 databases in IBM iSeries servers. You need to install odbc db2 drivers for iseries servers. Then in /etc/odbcinst.ini file you need to mention driver specifications and in /etc/odbc.ini, you need to mention the odbc dsn name, database name, and some other parameters to connect to the database. Though, you may also supply some parameters in the PDO_ODBC connect method.
  • 28. PHP AND SQL SERVER STORED PROCEDURE
  • 29. PHP AND SQL SERVER STORED PROCEDURE
  • 33. MYSQLI β€” THE MYSQLI CLASS οƒ’ mysqli::$affected_rows β€” Gets the number of affected rows in a previous MySQL operation οƒ’ mysqli::autocommit β€” Turns on or off auto-committing database modifications οƒ’ mysqli::begin_transaction β€” Starts a transaction οƒ’ mysqli::change_user β€” Changes the user of the specified database connection οƒ’ mysqli::character_set_name β€” Returns the default character set for the database connection οƒ’ mysqli::$client_info β€” Get MySQL client info οƒ’ mysqli::$client_version β€” Returns the MySQL client version as a stringmysqli::close β€” Closes a previously opened database connection
  • 34. MYSQLI β€” THE MYSQLI CLASS οƒ’ mysqli::commit β€” Commits the current transaction οƒ’ mysqli::$connect_errno β€” Returns the error code from last connect call οƒ’ mysqli::$connect_error β€” Returns a string description of the last connect error οƒ’ mysqli::__construct β€” Open a new connection to the MySQL server οƒ’ mysqli::debug β€” Performs debugging operations οƒ’ mysqli::dump_debug_info β€” Dump debugging information into the log οƒ’ mysqli::$errno β€” Returns the error code for the most recent function call
  • 35. MYSQLI β€” THE MYSQLI CLASS οƒ’ mysqli::$error_list β€” Returns a list of errors from the last command executed οƒ’ mysqli::$error β€” Returns a string description of the last error οƒ’ mysqli::$field_count β€” Returns the number of columns for the most recent query οƒ’ mysqli::get_charset β€” Returns a character set objectmysqli::get_client_info β€” Get MySQL client info οƒ’ mysqli_get_client_stats β€” Returns client per-process statistics οƒ’ mysqli_get_client_version β€” Returns the MySQL client version as an integer οƒ’ mysqli::get_connection_stats β€” Returns statistics about the client connection οƒ’ mysqli::$host_info β€” Returns a string representing the type of connection used οƒ’ mysqli::$protocol_version β€” Returns the version of the MySQL protocol used οƒ’ mysqli::$server_info β€” Returns the version of the MySQL server οƒ’ mysqli::$server_version β€” Returns the version of the MySQL server as an integer οƒ’ mysqli::get_warnings β€” Get result of SHOW WARNINGS
  • 36. MYSQLI β€” THE MYSQLI CLASS οƒ’ mysqli::$info β€” Retrieves information about the most recently executed querymysqli::init β€” Initializes MySQLi and returns a resource for use with mysqli_real_connect()mysqli::$insert_id β€” Returns the auto generated id used in the last querymysqli::kill β€” Asks the server to kill a MySQL threadmysqli::more_results β€” Check if there are any more query results from a multi querymysqli::multi_query β€” Performs a query on the databasemysqli::next_result β€” Prepare next result from multi_querymysqli::options β€” Set optionsmysqli::ping β€” Pings a server connection, or tries to reconnect if the connection has gone downmysqli::poll β€” Poll connectionsmysqli::prepare β€” Prepare an SQL statement for executionmysqli::query β€” Performs a query on the databasemysqli::real_connect β€” Opens a connection to a mysql servermysqli::real_escape_string β€” Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connectionmysqli::real_query β€” Execute an SQL query
  • 37. MYSQLI_STMT β€” THE MYSQLI_STMT CLASS οƒ’ mysqli_stmt::$affected_rows β€” Returns the total number of rows changed, deleted, or inserted by the last executed statementmysqli_stmt::attr_get β€” Used to get the current value of a statement attributemysqli_stmt::attr_set β€” Used to modify the behavior of a prepared statementmysqli_stmt::bind_param β€” Binds variables to a prepared statement as parametersmysqli_stmt::bind_result β€” Binds variables to a prepared statement for result storagemysqli_stmt::close β€” Closes a prepared statementmysqli_stmt::data_seek β€” Seeks to an arbitrary row in statement result setmysqli_stmt::$errno β€” Returns the error code for the most recent statement callmysqli_stmt::$error_list β€” Returns a list of errors from the last statement executed
  • 38. MYSQLI_RESULT β€” THE MYSQLI_RESULT CLASS οƒ’ mysqli_result::$current_field β€” Get current field offset of a result pointermysqli_result::data_seek β€” Adjusts the result pointer to an arbitrary row in the resultmysqli_result::fetch_all β€” Fetches all result rows as an associative array, a numeric array, or bothmysqli_result::fetch_array β€” Fetch a result row as an associative, a numeric array, or bothmysqli_result::fetch_assoc β€” Fetch a result row as an associative arraymysqli_result::fetch_field_direct β€” Fetch meta-data for a single fieldmysqli_result::fetch_field β€” Returns the next field in the result setmysqli_result::fetch_fields β€” Returns an array of objects representing the fields in a result setmysqli_result::fetch_object β€” Returns the current row of a result set as an objectmysqli_result::fetch_row β€” Get a result row as an enumerated array
  • 39. MYSQLI_DRIVER, MYSQLI_WARNING οƒ’ mysqli_driver β€” The mysqli_driver classmysqli_driver::embedded_server_end β€” Stop embedded server οƒ’ mysqli_driver::embedded_server_start β€” Initialize and start embedded server οƒ’ mysqli_driver::$report_mode β€” Enables or disables internal report functions οƒ’ mysqli_warning β€” The mysqli_warning classmysqli_warning::__construct β€” The __construct purpose οƒ’ mysqli_warning::next β€” The next purpose οƒ’ mysqli_sql_exception β€” The mysqli_sql_exception class
  • 40. PDO β€” THE PDO CLASS οƒ’ PDO::beginTransaction β€” Initiates a transactionPDO::commit β€” Commits a transactionPDO::__construct β€” Creates a PDO instance representing a connection to a databasePDO::errorCode β€” Fetch the SQLSTATE associated with the last operation on the database handlePDO::errorInfo β€” Fetch extended error information associated with the last operation on the database handlePDO::exec β€” Execute an SQL statement and return the number of affected rowsPDO::getAttribute β€” Retrieve a database connection attribute
  • 41. PDOSTATEMENT β€” THE PDOSTATEMENT CLASS οƒ’ PDOStatement::bindColumn β€” Bind a column to a PHP variablePDOStatement::bindParam β€” Binds a parameter to the specified variable namePDOStatement::bindValue β€” Binds a value to a parameterPDOStatement::closeCursor β€” Closes the cursor, enabling the statement to be executed again.PDOStatement::columnCount β€” Returns the number of columns in the result setPDOStatement::debugDumpParams β€” Dump an SQL prepared commandPDOStatement::errorCode β€” Fetch the SQLSTATE associated with the last operation on the statement handlePDOStatement::errorInfo β€” Fetch extended error information associated with the last operation on the statement handle
  • 42. PDOEXCEPTION, MISC οƒ’ PDOException β€” The PDOException class οƒ’ PDO DriversCUBRID (PDO) β€” CUBRID Functions (PDO_CUBRID) οƒ’ MS SQL Server (PDO) β€” Microsoft SQL Server and Sybase Functions (PDO_DBLIB) οƒ’ Firebird/Interbase (PDO) β€” Firebird/Interbase Functions (PDO_FIREBIRD) οƒ’ IBM (PDO) β€” IBM Functions (PDO_IBM)