An empty array is returned if there are zero results to fetch, or FALSE on failure. fetchAll($fetch_Style) – It returns an array containing all of the remaining rows in the result set, The array represents each row as either an array of column values or an object with properties corresponding to each column name.The fetch_style parameters determine how PDO returns the row. fetch($fetch_Style) – It fetches a row from a result set associated with a PDO Statement object.query($sql_statement) – It executes an SQL statement in a single function call, returning the result set(if any) returned by the statement as a PDO Statement object or FALSE on failure.Both provide the same level of security. MySQLi will work only with MySQL Database while PDO will work on 12 different database systems.MySQLi supports dual interface Procedural and object-oriented while PDO supports only Object-oriented.PDO will work on 12 different database systems.ĭifference and Similarities between MySQLi and PDO It supports only the Object-Oriented interface. Every DBMS has specific PDO drivers(s) that must be installed when you are using PDO in PHP applications. PDO is a database access layer that provides a fast and consistent interface for accessing and managing databases in PHP applications. There are three main API options when considering connecting to a MySQL database server.
0 Comments
Leave a Reply. |