Tag

PDO

0 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
Aug 29, 2024 · Backend Development

10 Advanced PHP Techniques to Boost Performance and Efficiency

This article introduces ten lesser‑known PHP tricks—including memory management, Composer dependency handling, the built‑in web server, anonymous classes, try‑catch error handling, generators, traits, built‑in functions, PDO, and namespaces—to help developers write more efficient, maintainable, and secure code.

ComposerGeneratorsMemory Management
0 likes · 9 min read
10 Advanced PHP Techniques to Boost Performance and Efficiency
IT Services Circle
IT Services Circle
Aug 19, 2024 · Backend Development

How Saki Fixed a PDO Compatibility Bug in PHP 8.1 and Contributed to the PHP Core

This article recounts how developer Saki discovered a PDO extension incompatibility after PHP 8.1 upgrade, submitted detailed bug reports and pull requests, added unit tests, resolved further SQL Server issues, and ultimately became a PHP core contributor, illustrating the open‑source contribution process.

Bug FixDatabasePDO
0 likes · 7 min read
How Saki Fixed a PDO Compatibility Bug in PHP 8.1 and Contributed to the PHP Core
php中文网 Courses
php中文网 Courses
Apr 24, 2024 · Backend Development

How to Connect to a Database Using PHP

This tutorial explains how to connect PHP to databases using both mysqli and PDO, covering connection setup, error handling, executing queries, and properly closing the connection, with complete code examples for each method.

MySQLPDOPHP
0 likes · 4 min read
How to Connect to a Database Using PHP
php中文网 Courses
php中文网 Courses
Jan 9, 2024 · Databases

Efficiently Inserting 10 Million Records into MySQL with PHP

This tutorial explains how to use PHP and PDO to quickly insert ten million rows into a remote MySQL database by preparing the connection, employing batch inserts, managing transactions, tuning MySQL settings, and optionally using the LOAD DATA statement for optimal performance.

Bulk InsertMySQLPDO
0 likes · 6 min read
Efficiently Inserting 10 Million Records into MySQL with PHP
php中文网 Courses
php中文网 Courses
Dec 21, 2023 · Backend Development

Implementing a Data Search Feature with PHP and Vue

This article demonstrates how to build a simple data search feature by creating a PHP backend API using PDO for database queries and a Vue.js frontend that sends Ajax requests, processes the JSON response, and displays matching student records in a list.

AJAXData SearchPDO
0 likes · 6 min read
Implementing a Data Search Feature with PHP and Vue
php中文网 Courses
php中文网 Courses
Nov 20, 2023 · Backend Development

How to Interact with Databases Using PHP: Connections, Queries, and Error Handling

This article explains how PHP can connect to various databases, execute queries, fetch results, insert or update records, close connections, handle errors, and address security concerns, providing code examples for both MySQLi and PDO extensions.

Backend DevelopmentDatabasePDO
0 likes · 5 min read
How to Interact with Databases Using PHP: Connections, Queries, and Error Handling
php中文网 Courses
php中文网 Courses
Oct 9, 2023 · Backend Development

Debugging and Optimizing Database Connections in PHP

This article explains how to debug and optimize PHP database connections using PDO and mysqli, demonstrates error handling and logging techniques, and presents performance improvements such as persistent connections, connection pooling, and query optimization with practical code examples.

Connection PoolDatabaseOptimization
0 likes · 6 min read
Debugging and Optimizing Database Connections in PHP
Laravel Tech Community
Laravel Tech Community
Sep 5, 2023 · Backend Development

Using MySQLi and PDO to Prevent SQL Injection in PHP

The article explains why directly concatenating user input into SQL queries leads to injection vulnerabilities and demonstrates how to secure PHP database operations using input validation, escaping functions, and prepared statements with MySQLi and PDO, while comparing related sanitization functions.

PDOSQL injectionmysqli
0 likes · 5 min read
Using MySQLi and PDO to Prevent SQL Injection in PHP
php中文网 Courses
php中文网 Courses
Mar 13, 2023 · Backend Development

How PHP Prepared Statements Prevent SQL Injection

This article explains how PHP's prepared statements and parameterized queries, especially using the PDO extension, protect against SQL injection by compiling query templates, binding parameters safely, and avoiding repeated parsing, while also showing practical code examples and Laravel's underlying implementation.

LaravelPDOPHP
0 likes · 5 min read
How PHP Prepared Statements Prevent SQL Injection
Laravel Tech Community
Laravel Tech Community
Jun 17, 2021 · Databases

PDO::errorCode – Retrieve the SQLSTATE of the Last Database Operation

PDO::errorCode is a PHP method that returns the SQLSTATE code—a five‑character identifier defined by the ANSI SQL standard—representing the outcome of the most recent operation on a database handle, or NULL if no operation has been performed.

DatabasePDOPHP
0 likes · 1 min read
PDO::errorCode – Retrieve the SQLSTATE of the Last Database Operation
Laravel Tech Community
Laravel Tech Community
Jun 16, 2021 · Backend Development

PDO::setAttribute – Setting Attributes for Database Handles

The article explains the PHP PDO::setAttribute method, describing its syntax, purpose of setting database handle attributes, available generic attributes, return values, and notes that some drivers may support additional specific attributes for.

DatabasePDOPHP
0 likes · 1 min read
PDO::setAttribute – Setting Attributes for Database Handles
Laravel Tech Community
Laravel Tech Community
Jun 15, 2021 · Backend Development

PDO::inTransaction – Checking If Inside a Transaction

The PDO::inTransaction method returns a boolean indicating whether the current database connection is actively inside a transaction, works only with drivers that support transactions, takes no parameters, and returns TRUE on success and FALSE on failure.

DatabasePDOPHP
0 likes · 1 min read
PDO::inTransaction – Checking If Inside a Transaction
Laravel Tech Community
Laravel Tech Community
Jun 14, 2021 · Backend Development

PDO::rollBack – Rolling Back a Transaction in PHP

The article explains how the PHP PDO::rollBack() method aborts the current transaction, restores autocommit mode when needed, outlines its parameter‑less signature, return values, and provides a complete code example demonstrating transaction handling and rollback behavior.

DatabasePDOPHP
0 likes · 2 min read
PDO::rollBack – Rolling Back a Transaction in PHP
Laravel Tech Community
Laravel Tech Community
Jun 9, 2021 · Backend Development

PDO::inTransaction – Check If Inside a Transaction

PDO::inTransaction is a PHP PDO method that returns a boolean indicating whether the current database connection is actively within a transaction, applicable only to drivers that support transactions, and it takes no parameters.

DatabasePDOPHP
0 likes · 1 min read
PDO::inTransaction – Check If Inside a Transaction
Laravel Tech Community
Laravel Tech Community
Jun 8, 2021 · Backend Development

Using PDO::query to Execute SQL and Return a PDOStatement in PHP

This article explains how the PDO::query method in PHP executes an SQL statement, returns the result as a PDOStatement object, details its parameters and return values, and provides a practical code example for retrieving and printing query results.

DatabasePDOPHP
0 likes · 2 min read
Using PDO::query to Execute SQL and Return a PDOStatement in PHP
Laravel Tech Community
Laravel Tech Community
Jun 6, 2021 · Backend Development

PDO::getAttribute – Retrieve a Database Connection Attribute

The article explains the PDO::getAttribute method, lists all PDO::ATTR_* constants that can be queried, describes its return behavior, and provides a PHP example demonstrating how to retrieve multiple connection attributes for debugging.

DatabaseExamplePDO
0 likes · 2 min read
PDO::getAttribute – Retrieve a Database Connection Attribute
Laravel Tech Community
Laravel Tech Community
Jun 5, 2021 · Backend Development

PDO::exec – Execute an SQL Statement and Return the Number of Affected Rows

The article explains PHP's PDO::exec method, detailing its signature, parameters, return value, and provides a complete example showing how to delete rows from a database table and retrieve the count of affected rows.

DatabasePDOSQL
0 likes · 2 min read
PDO::exec – Execute an SQL Statement and Return the Number of Affected Rows
Laravel Tech Community
Laravel Tech Community
Jun 4, 2021 · Backend Development

PDO::__construct – Creating a PDO Instance for Database Connections

The PDO::__construct method creates a PDO object that represents a connection to a database, detailing its parameters—DSN, username, password, and driver options—return value, and providing a complete PHP example of establishing and handling a MySQL connection.

DatabasePDOPHP
0 likes · 2 min read
PDO::__construct – Creating a PDO Instance for Database Connections
php中文网 Courses
php中文网 Courses
Apr 26, 2021 · Databases

Using PDO::quote to Safely Quote Strings in PHP

This article explains how to use PHP's PDO::quote function to safely add quotes to strings for SQL statements, describes its syntax and parameters, and provides two practical code examples demonstrating quoting of normal and potentially dangerous strings.

DatabasePDOPHP
0 likes · 3 min read
Using PDO::quote to Safely Quote Strings in PHP
php中文网 Courses
php中文网 Courses
Mar 19, 2021 · Backend Development

Understanding PDOStatement::fetch() Fetch Styles in PHP

This article explains the PDOStatement::fetch() method in PHP, detailing the available fetch style constants, their effects on result set formatting, and shows how to configure the statement to return only associative arrays for cleaner data handling.

DatabaseFetchModePDO
0 likes · 3 min read
Understanding PDOStatement::fetch() Fetch Styles in PHP