← CodeClarityLab Home
Browse by Category
+ added · updated 7d
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Diagram: N+1 Query Problem N+1 Query Problem PHP 5.1+
A performance anti-pattern where fetching N records triggers N additional queries — one per record — instead of a single JOIN.
2mo ago database intermediate
Optimistic Locking
A concurrency pattern using a version column to detect conflicting concurrent writes — no row locks held between read and write.
2mo ago database advanced
PDO Error Handling PHP 5.1+
PDO has three error modes — silent, warning, and exception — controlling how database errors surface.
2mo ago php beginner
PDO Fetch Modes PHP 5.1+
Constants controlling how PDO returns rows — as arrays, objects, or custom classes.
2mo ago php beginner
PDO lastInsertId() PHP 5.1+
Returns the auto-increment ID generated by the most recent INSERT statement.
2mo ago php beginner
PDO Named Placeholders PHP 5.1+
Named parameters (:name) in prepared statements — more readable than positional ? placeholders for queries with multiple parameters.
2mo ago php beginner
PDO query() vs prepare() PHP 5.1+
PDO query() executes raw SQL immediately — prepare() parameterises it. query() must never include user-controlled values.
CWE-89 OWASP A3:2021
2mo ago php beginner 9.8
Diagram: PDO Transactions PDO Transactions PHP 5.1+
PDO wraps multiple queries in an atomic unit — either all succeed or all roll back.
2mo ago php intermediate
PDO::ATTR_EMULATE_PREPARES PHP 5.1+
Controls whether PDO sends real prepared statements to the database or emulates them client-side in PHP.
CWE-89 OWASP A3:2021
2mo ago php intermediate
PDOStatement::bindParam() vs bindValue() PHP 5.1+
Two PDO methods for binding variables to placeholders — bindParam() binds by reference (evaluated at execute), bindValue() binds by value (evaluated immediately).
2mo ago php intermediate
PDOStatement::rowCount() PHP 5.1+
Returns the number of rows affected by the last DELETE, INSERT, or UPDATE — unreliable for SELECT.
2mo ago php beginner
PHP Generators PHP 5.5+
Functions using yield that produce values lazily — one at a time — instead of building a complete array in memory.
2mo ago php intermediate
SELECT FOR UPDATE
A locking read that acquires exclusive row locks — preventing other transactions from modifying selected rows until commit.
2mo ago database advanced
Soft Delete Pattern
Marking records as deleted with a deleted_at timestamp instead of physically removing them — preserving data for auditing and recovery.
2mo ago database intermediate
SQL Window Functions
Window functions (ROW_NUMBER, RANK, LAG, LEAD, SUM OVER) perform calculations across a set of rows related to the current row without collapsing them into a single aggregate — enabling rankings, running totals, and comparisons within result sets.
2mo ago database intermediate
Structured Logging PHP 8.0+
Emitting log entries as machine-parseable key-value pairs (JSON) rather than free-form strings — enabling filtering, aggregation, and alerting.
2mo ago observability intermediate
Test Doubles PHP 8.0+
Substitute objects used in tests to replace real dependencies — mocks, stubs, spies, fakes, and dummies each serve a different purpose.
2mo ago testing intermediate
Trie (Prefix Tree)
A tree where each node represents a character — paths from root to leaf spell out keys, enabling O(m) lookup, prefix search, and autocomplete where m is key length, independent of dataset size.
2mo ago data_structures intermediate
WebAssembly (Wasm)
A binary instruction format that runs at near-native speed in the browser and on servers — enabling C, Rust, and Go code to run alongside JavaScript without plugins.
2mo ago frontend advanced
Diagram: AI Alignment AI Alignment
The research and engineering discipline of ensuring AI systems pursue goals that are consistent with human values, intentions, and safety — not just stated objectives.
2mo ago ai_ml advanced
✓ schema.org compliant