php-sql-query-builder icon indicating copy to clipboard operation
php-sql-query-builder copied to clipboard

An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.

Results 45 php-sql-query-builder issues
Sort by recently updated
recently updated
newest added

- Style toc linebreak - Fix wrong chapter id 3.4.3 anchor

Hi I need count query, but I can't use in write function because ```ColumnQuery``` class doesn't implement from ```QueryInterface```. And count function returned ```ColumnQuery``` instance. ` $query = $builder->select() ->setTable('users')...

MySQL (maybe other DBs too) has a **REPLACE** statement and it will be very nice if in builder has opportunity to create this type of queries. It very similar to...

https://github.com/nilportugues/php-sql-query-builder/blob/cc3401099328ddfad54b2b801e38e05a50da11bd/src/Builder/Syntax/PlaceholderWriter.php#L81 This piece of code will replace the following tested values with 'NULL': '0', ''. which is incorrect. A NOT NULL column could be set to an empty string or...

I'll want to use your great work in combination with the WordPress [wpdb](https://developer.wordpress.org/reference/classes/wpdb/) class. But WordPress prepare ask for a sprintf()-like syntax in their [prepare](https://developer.wordpress.org/reference/classes/wpdb/prepare/) method. Is there a workaround...

``` foreach ($model_params as $join_key => $join_value) { if ($join_value->relationship !== null) { $query->leftJoin( $join_value->relationship, $join_key, $join_value->foreign_key, ); } } ``` Hi, how u can see I use left join...

Hi guys. Is it possible to create a selection from another query, for example: "select a. * From (select * from users bla bla bla ...)"?

So far the column alias will be removed, if a * is found in column name. This prevents for selecting the following: `$objQuery->setFunctionAsColum('SUM', ['Column1*Column2'], 'my_alias');` Now this can be done....

Hello @nilportugues! I run into an issue during using the query builder, I have next table structure. ```sql CREATE TABLE IF NOT EXISTS `Table` ( `UserID` int(1) NOT NULL, `EnumValue`...

Trying to use an empty string for a comparison causes the query builder to replace it with a string of NULL. Example: ```php $builder = new \NilPortugues\Sql\QueryBuilder\Builder\GenericBuilder; $select = $builder->select('SomeTable');...