1/26
Flashcards covering key concepts, functions, and definitions related to PHP mysqli and PDO operations.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the purpose of mysqli_connect() in PHP?
It establishes a connection to a MySQL database server using provided credentials.
What does mysqliconnecterrno() return?
It returns the error code from the last failed connection attempt.
What does mysqliconnecterror() provide?
A human-readable error message describing the last connection error.
Why should mysqli_close() be used?
To close an active connection to the MySQL database and free up resources.
What is the function of mysqli_query()?
It sends SQL queries to the MySQL database for execution.
What is the advantage of using mysqlimultiquery()?
It allows the execution of multiple SQL queries in a single call.
What does mysqlifetchassoc() return?
It fetches a row from a result set as an associative array.
How does mysqlifetcharray() differ from mysqlifetchassoc()?
mysqlifetcharray() returns a row as an associative, numeric, or both types of arrays.
What does mysqlifetchobject() return?
It returns a row from a result set as an object, with column names as properties.
What does mysqlifetchrow() return?
It retrieves a row as a numerical array indexed starting from 0.
What is the use of mysqlinumrows()?
It returns the total number of rows in a result set.
What is the purpose of mysqli_prepare()?
It prepares an SQL statement for execution to help prevent SQL injection.
What does mysqlistmtbind_param() do?
It binds variables to a prepared SQL statement as parameters.
What does mysqlistmtexecute() do?
It executes a previously prepared SQL statement.
What is the function of PDO::__construct?
It creates a new database connection using PDO.
What does PDO::beginTransaction() do?
It starts a database transaction.
What is the effect of calling PDO::commit()?
It saves all changes made during a transaction.
What happens when PDO::rollBack() is called?
It cancels all changes made during a transaction.
What is the use of PDO::setAttribute()?
It sets PDO attributes such as error mode or fetch mode.
What does PDO::exec() do?
It executes an SQL command like INSERT, UPDATE, or DELETE.
What does PDO::prepare() do?
It prepares an SQL statement for execution and prevents SQL injection.
What does PDO::lastInsertId() return?
It returns the ID of the last inserted row.
What information does PDO::errorInfo() return?
It provides detailed error information for debugging.
What does PDO::ATTR_AUTOCOMMIT do?
It determines whether changes to the database are automatically committed.
What is the function of PDO::ATTR_CASE?
It controls how column names are returned in result sets.
What does PDO::ATTR_ERRMODE control?
It sets the error reporting mode for PDO.
What is the purpose of PDO::ATTR_TIMEOUT?
It sets the connection timeout in seconds.