Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I have nothing but feels for you, man. I’ve been living this for like two weeks.
-
zuley196y@broseph thank you for the feels at least. Currently taking a break before I go back to tackle this. Hoping we both figure this out.
-
bahua128016y@zuley
I very highly recommend using a REST client like insomnia to test it, as it will cut through all the http handling for you and just show you what you need. -
zuley196y@devTea I really appreciate your suggestion. I looked up both clients and I kind of get it but I think I need to take a step back. Maybe I'm not handling the query results right. When I echo json_encode($query_results) what prints is the actual query string (SELECT FROM WHERE etc.). I feel like that shouldn't happen...? Also when I use fetchAll() nothing happens. I'm looking at w3schools website and they are using ->prepare() and ->execute() and ->get_results() which I am not. Is this where I'm going wrong? The way I am running the query is $results = $db->query($query); return $results. To print the results I am using a foreach loop in a printResults function and they print okay in a table format. But they dont seem to get passed to the json object. I am not looping when I am trying to create the object (in a separate function) bc I thought fetchAll() would do that, but as I said that doesn't work. Sorry for the long post but thanks for reading.
-
"i just want to understand this"
there's your problem.
repeat after me: "Javascript is not understood nor written. Javascript is referenced from other people's online repos that you have no control over, or, if you must, copypasted from random google search results."
Related Rants
I cant get a JSON object out of my query results!! I have been trying all day and I'm so frustrated and sad. I'm new to JavaScript, AJAX, and JSON. I just want to understand this. I've seen videos, tutorials, but I never get the expected results with jason_encode. And on the client side I don't even know if the request is good since I can't make the JSON object. :(
rant
first rant
js
ajax
issue
php
json
sadness