database-repository

Execute MySQLi prepared statements for IBL5 database CRUD operations.

1|Updated Jan 26, 2020
One-click install
npx skills add https://github.com/a-jay85/IBL5 --skill database-repository-a-jay85
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-repository
Source: https://github.com/a-jay85/IBL5/tree/main/.claude/skills/database-repository
Command: npx skills add https://github.com/a-jay85/IBL5 --skill database-repository-a-jay85

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized and secure way to interact with the IBL5 database, preventing common SQL injection vulnerabilities and simplifying data access.

Core Features & Use Cases

  • Prepared Statements: Ensures all database queries are executed safely using prepared statements, protecting against SQL injection.
  • CRUD Operations: Offers methods for fetching single records, multiple records, executing updates/inserts/deletes, and retrieving the last inserted ID.
  • Type Safety: Clearly defines expected data types for query parameters, reducing errors.
  • Use Case: When you need to retrieve player data by ID, update a player's team, or insert a new game record, this Skill provides the robust methods to do so safely and efficiently.

Quick Start

Use the database-repository skill to fetch all players for team ID 5.

Frequently Asked Questions about database-repository

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in PHP when querying a MySQL database?

Preventing SQL injection in PHP requires using prepared statements with MySQLi to bind parameters explicitly. This Skill enforces type safety through parameter binding, ensuring all database queries execute safely without raw string concatenation.

What is the best way to implement a repository pattern for MySQLi CRUD operations?

The repository pattern for MySQLi CRUD operations standardizes data access by offering methods to fetch single or multiple rows, execute updates, and retrieve the last inserted ID. This Skill provides a structured approach to safely manage these modifications.

Can I fetch multiple rows and retrieve the last insert ID using PHP prepared statements?

Yes, you can fetch multiple rows and retrieve the last insert ID using PHP prepared statements. This Skill facilitates safe execution of select queries to return single or multiple records and tracks the last inserted ID after data modifications.

Why does my database repository fail when binding parameters in PHP?

Database repository parameter binding in PHP fails when expected data types do not match the provided values. This Skill enforces type safety through explicit parameter binding and includes error handling to manage common database operation failures.

Do I need MySQLi to use a secure database repository in PHP?

Yes, MySQLi is required to use this secure database repository in PHP. The Skill is specifically designed to interact with the IBL5 database using MySQLi prepared statements to safely execute queries and prevent SQL injection vulnerabilities.