php


getting count of the same price grouping by the same transaction id


I'm trying to get the count of all prices with the same transaction type id , but i'm getting error with that , don't know the reason .
here's my code :
$Query =TableRegistry::get('Transactions')->find()->select('Transactions.price','Transactions.transactions_type_id')
->contain('TransactionsTypes');
$Query->select([
'Transactions.price' ,
'count' => $Query->func()->count('*')
])
->group('Transactions.transactions_type_id');
and if i'm going to print it , getting me that error :
100
\plugins\Budgets\src\Controller\PagesController.php (line 143)
object(Cake\ORM\Query) {
'(help)' => 'This is a Query object, to get the results execute or iterate it.',
'sql' => 'SELECT Transactions.price AS `Transactions__price`, (COUNT(*)) AS `count` FROM transactions Transactions LEFT JOIN transactions_types TransactionsTypes ON TransactionsTypes.id = (Transactions.transactions_type_id) GROUP BY Transactions.transactions_type_id ',
'params' => [],
'defaultTypes' => [
'Transactions__id' => 'integer',
'Transactions.id' => 'integer',
'id' => 'integer',
'Transactions__transactions_type_id' => 'integer',
'Transactions.transactions_type_id' => 'integer',
'transactions_type_id' => 'integer',
'Transactions__financial_year_id' => 'integer',
'Transactions.financial_year_id' => 'integer',
Which 100 is the value of the first only column of the price with the same transaction type !
So how to get the count of all prices with the same transaction type id ?
Thank you

Related Links

Symfony 2: Multiple forms generated list of objects
facebook api file upload getting 324 error
MySQL fetch array not collecting and returning all the rows | PHP | MySQL
mysql table bind next row and current row
How can I check my ip address?
PDO debugging update query using bindValue
PHP Errors after Migrating Wordpress Site
How to Access to Laravel 5 with Pingpong-Modules to a specific Module
Slow queries with PHP application but not with phpMyadmin
How can I define global variables inside a twig template file?
JSONObject text search to Mysql
php codeigniter count rows
How to pass extra parameters on extension's class from main config?
Eloquent relationship. Changed table name
Model not updated due to validation error
Enable Errors in Openshift PHP

Categories

HOME
artificial-intelligence
protocol-buffers
opencart
android-fragments
bokeh
paypal-ipn
long-integer
scroll
transactions
risk-management
ios-simulator
iverilog
ipv6
video-streaming
haxe
onvif
hystrix
siesta
feature-extraction
smartgwt
django-rq
orange-api
parceler
spyder
node-webkit
spring-ldap
unity-container
web-analytics
opentext
openbravo
marquee
iwebbrowser2
ninject
jsonresult
google-play-developer-api
xenapp
apptentive
autoencoder
express-session
dreamfactory
code-rally
iscroll
spring-restcontroller
deployd
image-registration
nothing
uiautomatorviewer
nonlinear-functions
amazon-elastic-beanstalk
winmerge
mobile-angular-ui
emacs25
degrees
pbx
streamwriter
okio
decoder
perforce-integrate
static-methods
deferred-rendering
urbit
django-validation
servicestack-bsd
sqlbase
darwin
kotlin-android-extensions
tkx
uno
thoughtworks-go
utf8-decode
igor
nidaqmx
iosched
postgres-xc
jacob
delphi-xe4
tfs-sdk
towers-of-hanoi
instance-variables
uitextfielddelegate
kobold2d
type-safety
groovy-console
vows
office-automation
rtd
bll
anonymous-types
icicles
.net-services
processors
tacit-programming
gtktextview
xap
comment-conventions
community-server
bindable-linq
account-management
webclient.uploaddata

Resources

Encrypt Message