Reputation: 206
I have tried every where all examples I came across but still have the same problem error 'htmlentities() expects parameter 1 to be string, array given' I need to select count from the database and would like to use the raw select as i will have more flexibility on it but any point towards the right direction will be appreciated here is what i have been doing'
$totalOpen = DB::table('dam')
->select(array('dam.*', DB::raw('COUNT(dam.mivisjobid) as followers')))
->join('miviswf','miviswf.mivisid','=','dam.mivisjobid')
->whereRaw( 'miviswf.mivisid=dam.mivisjobid')
->whereIn('miviswf.Status', $inputIds) // pass an array
->orderBy('miviswf.datetimesubmitted', 'ASC');'
and i get this error 'htmlentities() expects parameter 1 to be string, object given (View: '
Upvotes: 0
Views: 802
Reputation: 857
Try with this, don't use array inside the select method
->select('dam.*', DB::raw('COUNT(dam.mivisjobid) as followers'))
for reference: https://laravel.com/docs/5.2/queries#selects
Upvotes: 0