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 make auto increment of string like ALG030001 in php [closed]
Good practice to link script on a page getting loaded by ajax
Connecting to mysql database in php
mysql | Nested set to select box
Laravel - routing to a folder inside “views”
WP mail - Delivery failed: unknown error, how to debug?
Bootstrap modal form replace with JSON
404 Not Found error after commit changes on PHP application Openshift
want to convert my date formate 21/10/60 to 21-10-1960
Difference between sentences of cronjobs
SOLVED - PHP Compare 2 Arrays with time ranges
scandir() scan by increasing number
How to get the ID of all the checked boxes on displayed data base QUICKFIX?
How to fix include_once issues in my code?
Looking to give MailChimp dynamic content?
My image in my database is not posting on my site (PHP MySQL)

Categories

HOME
opengl
focus
jms
softlayer
concurrency
tcsh
greasemonkey
vue-resource
elk-stack
mosquitto
facebook-android-sdk
sentry
javafx-8
pyresttest
jpa-criteria
yahoo
nexus3
cname
createjs
stimulsoft
xbox360
corona
bnf
mixpanel
cpu-usage
clr
angular2-highcharts
firemonkey-style
react-dnd
web-config-transform
spreadsheetgear
jackrabbit-oak
tortoisehg
basex
cube
laravel-4.2
substance
envoy
d3.js-v4
reporting
universal
osx-lion
mongoengine
apptentive
db2-luw
xerces-c
identify
microkernel
klee
yoast
code-push
cyanogenmod
head.js
node-apn
http-basic-authentication
wikimapia
gmaps.js
msxml
word-2016
hmmlearn
adobe-reader
ipywidgets
metabase
dmarc
jsf-2.3
always-on-top
oci
jtag
android-async-http
vaadin4spring
jsr363
management-studio-express
android-mapview
perceptron
ibm-was
android-studio-import
css-paged-media
hmisc
uitest
roxygen2
sequence-sql
kotlin-android-extensions
datagridcomboboxcolumn
nesper
tabris
nidaqmx
osascript
sqlbindparameter
flipboard
vlab
iirf
jquery-lazyload
html-frames
days
contextswitchdeadlock
system-requirements
audiotoolbox
wndproc
multidrop-bus
infopath-2007
glassfish-esb
css-friendly
webresponse
active-record-query
sqlsitemapprovider
index.dat
motif
remote-working
synthesizer

Resources

Encrypt Message