SQLHelper
This is a helping class for the users of PHP with SQL in which the user can only use bind_result()! This makes it easier to use!
Install / Use
/learn @JaredScar/SQLHelperREADME
SQLHelper
Hey welcome to SQLHelper, a PHP SQL class made for people who don't have access to the MySQLi function get_result, but have access to MySQLi bind_result only. Everyone is free to use this. Just please give credit where credit is due and share the resource so others can have the pleasure of using it! Thanks for checking it out!
How does it work?
Great question dude! The way it works is quite simple. Here are some examples and explanations :)
Declaring the helper
$helper = new SQLHelper('localhost', 'BadgerDev', 'password', 'flooddb', 3306);
Preparing Statement
$helper->prepare("SELECT city FROM usa WHERE state = ?");
Binding params
$helper->bindParams("s", "Wyoming");
Handling execution
if($helper->execute()) { /* Returns boolean dependent on if it was executed without error */
}
Getting number of rows
$helper->num_rows // Can only be ran after execute() function ran
Looping through Associative Array
while ($row = $helper->get_both_array_results()) {
echo 'The city is: ' . $row['city'];
}
SQL Objects:
Looping through SQL Object
while($row = $helper->get_results_as_objs()) {
echo 'One of the IDs to the query is: ' . $row->id;
}
Getting the single SQL Object
$helper->get_sql_obj()->id; // This is the ID column value of query
Related Skills
feishu-drive
337.7k|
things-mac
337.7kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
337.7kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
