php


Laravel DB query throwing 'ErrorException: htmlentities() expects parameter 1 to be string…'


When I run the below query:
`$this_application = \DB::table('applications')->where('application_id', '9650-9348-8494-8846')->first();`
I get the following error:
Next ErrorException: htmlentities() expects parameter 1 to be string, object given (View: /home/forge/default/resources/views/a_page.blade.php) in /home/forge/default/vendor/laravel/framework/src/Illuminate/Support/helpers.php:466
Stack trace:
#0 /home/forge/default/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(44): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 1)
#1 /home/forge/default/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath('/home/forge/def...', Array)
What am I doing wrong? I can change the query or columns and I still get the same error. The hard coded ID was a replacement for the dynamic one that gets passed in, incase that was the issue.
The query is inside a controller.
The error is associated with how you're displaying the data in the view a_page.blade.php. You must be trying to do something like {{ $this_application }}, instead use the properties that you fetch like {{ $this_application->application_id }}
We could help you better if you shared the view code.
I think you are trying to print an array in a_page.blade.php with {{}} instead of array element. {{}} outputs string and not an array. try to output {{$this_application->application_id }} as #Sandeesh suggested

Related Links

How to get the userID to complete the change of password?
update mysql with Facebook api
How do I convert this specific time into the one here?
CakePHP redirect to another url but same controller
MySQLi result set chaning when running the same query
How to make var_dump();die in magento downloadble products
In ZF2, how can I access the Response object inside a controller plugin?
How to determine if posting JSON with PHP cURL is succeed?
how to change existing environment variables in my openshift application?
PHP Wordpress Calendar skips February
Updating matching columns from two tables
Instantiating the self class inside a method?
html text field validation via php
Refresh page with ComboBox without refresh
gettext return wrong language
How to load site resources regardless of parent file's path

Categories

HOME
memory
list
d3.js
paypal-ipn
message-queue
braintree
whmcs
gentelella
drag-and-drop
native-base
polymer-2.x
documentum
reselect
rest-assured
asciimath
opam
yii2-basic-app
sqlplus
neo4j.rb
ratio
function-points
strophe.js
webviewclient
ccavenue
macromedia
miniprofiler
openbr
toad
netbios
mapnik
caesar-cipher
microsoft-certifications
cloudera-manager
autoencoder
busboy
bluemixtools
google-now
grails3.2.0
contactless-smartcard
expandablelistview
morphline
bit-shift
nonlinear-functions
ilrepack
popen
wikimapia
swiperefreshlayout
zend-server
emf-compare
bpms
unsigned
wicked-pdf
adjacency-list
timestamping
mathnet
fdt
uitest
physicsjs
mathematical-expressions
google-hangouts
sunos
full-text-indexing
forio-contour
hyperloglog
bittorrent-sync
xulrunner
radius-protocol
oxygene
spring-social-linkedin
progress-db
statechart
reentrancy
xmlwriter
smartfox
multiple-dispatch
uitextfielddelegate
kaazing
yuidoc
azure-acs
rtd
django-pagination
jdownloader
.net-services
version-control-migration
downloadfile

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile