Download the PHP package hasan-22/query-builder without Composer
On this page you can find all versions of the php package hasan-22/query-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hasan-22/query-builder
More information about hasan-22/query-builder
Files in hasan-22/query-builder
Package query-builder
Short Description PHP SQL query builder using PDO
License MIT
Homepage https://github.com/HASSAN-22/query-builder
Informations about the package query-builder
PDO QUERY BUILDER
PHP SQL query builder using PDO. It's a quick and light library featuring a smart join builder, which automatically creates table joins for you.
Features
- Easy interface for creating robust queries
- Supports any database compatible with PDO
- Ability to build complex SELECT, INSERT, UPDATE & DELETE queries with little code
- Type hinting for magic functions with code completion in smart IDEs
Install
Driver:
First make the config file exactly like this Config file is not necessary config.php
Then create a custom driver class for the connection like this
Mysql.php
Then create new instance of DB
Set table and fetch all records
In the get()
function, you can specify which columns to get
Or you can use all()
function to get all records
Execute queries for a single or many record by ID
If you want add condition follow my lead
Some Where
functions
Some Having
functions
Join functions
You can use where
or having
condition with join
functions
CRUD functions
For insert data use create
function
Insert single data
Insert multiple data
Update record
Delete record
Transaction
Debug
Only works on functions whose return value is Object of class DB
.
Functions
Functions | return |
---|---|
table | Object of class DB |
get | Array |
all | Array |
find | object \ array |
newQQuery | Array |
count | object |
latest | Object of class DB |
orderBy | Object of class DB |
rand | Object of class DB |
groupBy | Object of class DB |
limit | Object of class DB |
take | Object of class DB |
first | object |
last | object |
max | object |
min | object |
sum | object |
avg | object |
where | Object of class DB |
orWhere | Object of class DB |
whereNull | Object of class DB |
orWhereNull | Object of class DB |
whereNotNull | Object of class DB |
orWhereNotNull | Object of class DB |
whereIn | Object of class DB |
orWhereIn | Object of class DB |
whereNotIn | Object of class DB |
orWhereNotIn | Object of class DB |
whereBetween | Object of class DB |
orWhereBetween | Object of class DB |
whereNotBetween | Object of class DB |
orWhereNotBetween | Object of class DB |
exists | Object of class DB |
orExists | Object of class DB |
notExists | Object of class DB |
orNotExists | Object of class DB |
having | Object of class DB |
orHaving | Object of class DB |
havingNull | Object of class DB |
orHavingNull | Object of class DB |
havingNotNull | Object of class DB |
orHavingNotNull | Object of class DB |
havingIn | Object of class DB |
orHavingIn | Object of class DB |
havingNotIn | Object of class DB |
orHavingNotIn | Object of class DB |
havingBetween | Object of class DB |
orHavingBetween | Object of class DB |
havingNotBetween | Object of class DB |
orHavingNotBetween | Object of class DB |
innerJoin | Object of class DB |
leftJoin | Object of class DB |
rightJoin | Object of class DB |
crossJoin | Object of class DB |
create | boolean |
update | boolean |
delete | boolean |
beginTransaction | void |
rollback | void |
commit | void |
getDbName | string |
currentId | object |
lastInsertId | object |
emptyQuery | void |
debug | string |