close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

JSON Data display from database

Thread began 3/16/2023 1:32 pm by Daniel | Last modified 3/23/2023 5:34 pm by Ray Borduin | 232 views | 4 replies |

Daniel

JSON Data display from database

Good Day,
I'm having problems to display the JSON string in my database this is what the code looks like:
$display = new WA_MySQLi_RS("display",$valostaradmin,0);
$display->setQuery("SELECT * FROM `dvinspection` WHERE `id` = 11");
$display->execute();

When I do json decode withj php it doesnt display like it is suppose to. Do you have any advise that can make it work?

Thank you for all your help until now.

Daniel.

Sign in to reply to this post

Daniel

This is what the string looks like in the MySQL database:
{"date":"2023-03-16","manager":"\u00a0Daniel Snyman","driver":"Japie Pretorius","regNr":"123GP","model":"Mercedes\n","engineOil":"engineOil","hydraulicOil":"hydraulicOil","htf":"htf","coolant":"coolant","radiator":"radiator","batterySecWatLev":"batterySecWatLev","batteryPolesClamps":"batteryPolesClamps","wheelsNuts":"wheelsNuts","mastCarriageRollers":"mastCarriageRollers","operatorSeat":"operatorSeat","hydrCylindSteering":"hydrCylindSteering","hydrHoses":"hydrHoses","airFilter":"airFilter","brakeFluid":"brakeFluid","brakesHandbrake":"brakesHandbrake","hourMeterGauges":"hourMeterGauges","lightsHooter":"lightsHooter","leversControls":"leversControls","footPedals":"footPedals","beaconLightOrange":"beaconLightOrange","trailerPlug":"trailerPlug","serviceBook":"yes","radioFaceWorking":"yes","spareWheel":"yes","jackAndTools":"yes","triangle":"yes","fireExtinghuiser":"yes","HMRStart":"777","HMRFinnish":"555","drivSignature":"Japie Pretorius","supervSignature":"Daniel Snyman"}

If I copy this string from the broswer and display it with json decode as a normal php array it works fine. But if I try directly through the first code example that I showed it doesnt work with json decode.

Sign in to reply to this post

Dave BuchholzBeta Tester

Try this <?php echo json_decode($display->getColumnVal("field_holding_json",false)); ?>

Sign in to reply to this post

Daniel

Thank you Dave Buchholz, Jesus Christ thankfully helped me before you gave me this answer. But thank you for your help I appreciate it.

Sign in to reply to this post

Ray BorduinWebAssist

Thanks Dave! Long time no see

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...