You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1 group by truck_items.user_id having act_item Bledne zapytanie:
Array
(
    [0] => Array
        (
            [file] => /home/paxnet/domains/paxnet.info/public_html/libs/adodb/drivers/adodb-mysqli.inc.php
            [line] => 1022
            [function] => ExecuteIni
            [class] => ADODB_mysqli
            [object] => ADODB_mysqli Object
                (
                    [databaseType] => mysqli
                    [dataProvider] => native
                    [hasInsertID] => 1
                    [hasAffectedRows] => 1
                    [metaTablesSQL] => SHOW TABLES
                    [metaColumnsSQL] => SHOW COLUMNS FROM %s
                    [fmtTimeStamp] => 'Y-m-d H:i:s'
                    [hasLimit] => 1
                    [hasMoveFirst] => 1
                    [hasGenID] => 1
                    [isoDates] => 1
                    [sysDate] => CURDATE()
                    [sysTimeStamp] => NOW()
                    [hasTransactions] => 1
                    [forceNewConnect] => 
                    [poorAffectedRows] => 1
                    [clientFlags] => 0
                    [substr] => substring
                    [port] => 
                    [socket] => 
                    [_bindInputArray] => 
                    [nameQuote] => `
                    [optionFlags] => Array
                        (
                            [0] => Array
                                (
                                    [0] => 5
                                    [1] => 0
                                )

                        )

                    [ini_name] => 
                    [_query] => 
	select
		count(*) as act_item,
		truck_users_packs.user_id as u_id,
		truck_packs_amount.pack_items_amount as pack_amount,
		truck_packs_amount.pack_special as special,
		truck_packs_amount.pack_id as special_id
	from
		truck_users_packs
		left join truck_items on (truck_items.user_id=truck_users_packs.user_id and truck_items.item_active="1")
		left join truck_packs_amount on (truck_packs_amount.pack_id=truck_users_packs.pack_id)
	where
		truck_users_packs.pack_date_expiration<=1519254000 and
		truck_users_packs.pack_type="amount" and
		=1
	group by
		truck_items.user_id 
	having act_item 
	select
		count(*) as act_item,
		truck_users_packs.user_id as u_id,
		truck_packs_amount.pack_items_amount as pack_amount,
		truck_packs_amount.pack_special as special,
		truck_packs_amount.pack_id as special_id
	from
		truck_users_packs
		left join truck_items on (truck_items.user_id=truck_users_packs.user_id and truck_items.item_active="1")
		left join truck_packs_amount on (truck_packs_amount.pack_id=truck_users_packs.pack_id)
	where
		truck_users_packs.pack_date_expiration<=1519254000 and
		truck_users_packs.pack_type="amount" and
		=1
	group by
		truck_items.user_id 
	having act_item
                    [_old_fetch_mode] => 2
                    [_result] => 1
                    [count_rows] => 
                    [insert_id] => 13376
                    [affected_rows] => 
                    [debug_times] => 
                    [fileCheck] => 
                    [_times] => Array
                        (
                        )

                    [_queries] => Array
                        (
                        )

                    [_backtrace] => Array
                        (
                        )

                    [_cache_clear] => 1
                    [now] => Array
                        (
                        )

                    [cacheFlush] => 
                    [_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);
                    [_genSeqSQL] => create table %s (id int not null)
                    [_genSeq2SQL] => insert into %s values (%s)
                    [_dropSeqSQL] => drop table %s
                    [database] => paxnet_handel
                    [host] => localhost
                    [user] => paxnet_handel
                    [password] => n316shd
                    [debug] => 
                    [maxblobsize] => 262144
                    [concat_operator] => +
                    [length] => length
                    [random] => rand()
                    [upperCase] => upper
                    [fmtDate] => 'Y-m-d'
                    [true] => 1
                    [false] => 0
                    [replaceQuote] => \'
                    [charSet] => 
                    [metaDatabasesSQL] => 
                    [uniqueOrderBy] => 
                    [emptyDate] =>  
                    [emptyTimeStamp] =>  
                    [lastInsID] => 
                    [hasTop] => 
                    [readOnly] => 
                    [genID] => 0
                    [raiseErrorFn] => 
                    [cacheSecs] => 
                    [arrayClass] => ADORecordSet_array
                    [noNullStrings] => 
                    [numCacheHits] => 0
                    [numCacheMisses] => 0
                    [pageExecuteCountRows] => 1
                    [uniqueSort] => 
                    [leftOuter] => 
                    [rightOuter] => 
                    [ansiOuter] => 
                    [autoRollback] => 
                    [fnExecute] => 
                    [fnCacheExecute] => 
                    [blobEncodeType] => 
                    [rsPrefix] => ADORecordSet_
                    [autoCommit] => 1
                    [transOff] => 0
                    [transCnt] => 0
                    [fetchMode] => 
                    [_oldRaiseFn] => 
                    [_transOK] => 
                    [_connectionID] => mysqli Object
                        (
                            [affected_rows] => -1
                            [client_info] => mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
                            [client_version] => 50012
                            [connect_errno] => 0
                            [connect_error] => 
                            [errno] => 1064
                            [error] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1
	group by
		truck_items.user_id 
	having act_item Array
                                (
                                    [0] => Array
                                        (
                                            [errno] => 1064
                                            [sqlstate] => 42000
                                            [error] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1
	group by
		truck_items.user_id 
	having act_item 0
                            [host_info] => Localhost via UNIX socket
                            [info] => Records: 4  Duplicates: 0  Warnings: 4
                            [insert_id] => 13376
                            [server_info] => 5.5.46-MariaDB
                            [server_version] => 50546
                            [stat] => Uptime: 42122143  Threads: 2  Questions: 3453314258  Slow queries: 2519  Opens: 82836342  Flush tables: 2  Open tables: 399  Queries per second avg: 81.983
                            [sqlstate] => 00000
                            [protocol_version] => 10
                            [thread_id] => 216918299
                            [warning_count] => 4
                        )

                    [_errorMsg] => 
                    [_errorCode] => 
                    [_queryID] => 
                    [_isPersistentConnection] => 
                    [_evalAll] => 
                    [_affected] => 
                    [_logsql] => 
                    [_transmode] => 
                    [databaseName] => paxnet_handel
                    [use_ini_file] => 1
                )

            [type] => ->
            [args] => Array
                (
                    [0] => 
	select
		count(*) as act_item,
		{p1.u_id} as u_id,
		{p3.amount} as pack_amount,
		{p3.special} as special,
		{p3.id} as special_id
	from
		{p1.tbnm}
		left join {p2.tbnm} on ({p2.u_id}={p1.u_id} and {p2.active}="1")
		left join {p3.tbnm} on ({p3.id}={p1.p_id})
	where
		{p1.date}<=1519254000 and
		{p1.p_type}="amount" and
		{p1.active}=1
	group by
		{p2.u_id} 
	having act_item 
                )

        )

    [1] => Array
        (
            [file] => /home/paxnet/domains/paxnet.info/public_html/content/data/my_truck/check_users_offers.php
            [line] => 138
            [function] => while_db
            [class] => ADODB_mysqli
            [object] => ADODB_mysqli Object
                (
                    [databaseType] => mysqli
                    [dataProvider] => native
                    [hasInsertID] => 1
                    [hasAffectedRows] => 1
                    [metaTablesSQL] => SHOW TABLES
                    [metaColumnsSQL] => SHOW COLUMNS FROM %s
                    [fmtTimeStamp] => 'Y-m-d H:i:s'
                    [hasLimit] => 1
                    [hasMoveFirst] => 1
                    [hasGenID] => 1
                    [isoDates] => 1
                    [sysDate] => CURDATE()
                    [sysTimeStamp] => NOW()
                    [hasTransactions] => 1
                    [forceNewConnect] => 
                    [poorAffectedRows] => 1
                    [clientFlags] => 0
                    [substr] => substring
                    [port] => 
                    [socket] => 
                    [_bindInputArray] => 
                    [nameQuote] => `
                    [optionFlags] => Array
                        (
                            [0] => Array
                                (
                                    [0] => 5
                                    [1] => 0
                                )

                        )

                    [ini_name] => 
                    [_query] => 
	select
		count(*) as act_item,
		truck_users_packs.user_id as u_id,
		truck_packs_amount.pack_items_amount as pack_amount,
		truck_packs_amount.pack_special as special,
		truck_packs_amount.pack_id as special_id
	from
		truck_users_packs
		left join truck_items on (truck_items.user_id=truck_users_packs.user_id and truck_items.item_active="1")
		left join truck_packs_amount on (truck_packs_amount.pack_id=truck_users_packs.pack_id)
	where
		truck_users_packs.pack_date_expiration<=1519254000 and
		truck_users_packs.pack_type="amount" and
		=1
	group by
		truck_items.user_id 
	having act_item 
	select
		count(*) as act_item,
		truck_users_packs.user_id as u_id,
		truck_packs_amount.pack_items_amount as pack_amount,
		truck_packs_amount.pack_special as special,
		truck_packs_amount.pack_id as special_id
	from
		truck_users_packs
		left join truck_items on (truck_items.user_id=truck_users_packs.user_id and truck_items.item_active="1")
		left join truck_packs_amount on (truck_packs_amount.pack_id=truck_users_packs.pack_id)
	where
		truck_users_packs.pack_date_expiration<=1519254000 and
		truck_users_packs.pack_type="amount" and
		=1
	group by
		truck_items.user_id 
	having act_item
                    [_old_fetch_mode] => 2
                    [_result] => 1
                    [count_rows] => 
                    [insert_id] => 13376
                    [affected_rows] => 
                    [debug_times] => 
                    [fileCheck] => 
                    [_times] => Array
                        (
                        )

                    [_queries] => Array
                        (
                        )

                    [_backtrace] => Array
                        (
                        )

                    [_cache_clear] => 1
                    [now] => Array
                        (
                        )

                    [cacheFlush] => 
                    [_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);
                    [_genSeqSQL] => create table %s (id int not null)
                    [_genSeq2SQL] => insert into %s values (%s)
                    [_dropSeqSQL] => drop table %s
                    [database] => paxnet_handel
                    [host] => localhost
                    [user] => paxnet_handel
                    [password] => n316shd
                    [debug] => 
                    [maxblobsize] => 262144
                    [concat_operator] => +
                    [length] => length
                    [random] => rand()
                    [upperCase] => upper
                    [fmtDate] => 'Y-m-d'
                    [true] => 1
                    [false] => 0
                    [replaceQuote] => \'
                    [charSet] => 
                    [metaDatabasesSQL] => 
                    [uniqueOrderBy] => 
                    [emptyDate] =>  
                    [emptyTimeStamp] =>  
                    [lastInsID] => 
                    [hasTop] => 
                    [readOnly] => 
                    [genID] => 0
                    [raiseErrorFn] => 
                    [cacheSecs] => 
                    [arrayClass] => ADORecordSet_array
                    [noNullStrings] => 
                    [numCacheHits] => 0
                    [numCacheMisses] => 0
                    [pageExecuteCountRows] => 1
                    [uniqueSort] => 
                    [leftOuter] => 
                    [rightOuter] => 
                    [ansiOuter] => 
                    [autoRollback] => 
                    [fnExecute] => 
                    [fnCacheExecute] => 
                    [blobEncodeType] => 
                    [rsPrefix] => ADORecordSet_
                    [autoCommit] => 1
                    [transOff] => 0
                    [transCnt] => 0
                    [fetchMode] => 
                    [_oldRaiseFn] => 
                    [_transOK] => 
                    [_connectionID] => mysqli Object
                        (
                            [affected_rows] => -1
                            [client_info] => mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
                            [client_version] => 50012
                            [connect_errno] => 0
                            [connect_error] => 
                            [errno] => 0
                            [error] => 
                            [error_list] => Array
                                (
                                )

                            [field_count] => 0
                            [host_info] => Localhost via UNIX socket
                            [info] => Records: 4  Duplicates: 0  Warnings: 4
                            [insert_id] => 13376
                            [server_info] => 5.5.46-MariaDB
                            [server_version] => 50546
                            [stat] => Uptime: 42122143  Threads: 2  Questions: 3453314258  Slow queries: 2519  Opens: 82836342  Flush tables: 2  Open tables: 399  Queries per second avg: 81.983
                            [sqlstate] => 00000
                            [protocol_version] => 10
                            [thread_id] => 216918299
                            [warning_count] => 4
                        )

                    [_errorMsg] => 
                    [_errorCode] => 
                    [_queryID] => 
                    [_isPersistentConnection] => 
                    [_evalAll] => 
                    [_affected] => 
                    [_logsql] => 
                    [_transmode] => 
                    [databaseName] => paxnet_handel
                    [use_ini_file] => 1
                )

            [type] => ->
            [args] => Array
                (
                    [0] => 
	select
		count(*) as act_item,
		{p1.u_id} as u_id,
		{p3.amount} as pack_amount,
		{p3.special} as special,
		{p3.id} as special_id
	from
		{p1.tbnm}
		left join {p2.tbnm} on ({p2.u_id}={p1.u_id} and {p2.active}="1")
		left join {p3.tbnm} on ({p3.id}={p1.p_id})
	where
		{p1.date}<=1519254000 and
		{p1.p_type}="amount" and
		{p1.active}=1
	group by
		{p2.u_id} 
	having act_item Array
        (
            [file] => /home/paxnet/domains/paxnet.info/public_html/index.php
            [line] => 85
            [args] => Array
                (
                    [0] => /home/paxnet/domains/paxnet.info/public_html/content/data/my_truck/check_users_offers.php
                )

            [function] => include
        )

)