Meaningless Drivel is fun!*
The moose likes PHP and the fly likes org.json.JSONException: No value for user Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "org.json.JSONException: No value for user" Watch "org.json.JSONException: No value for user" New topic
Author

org.json.JSONException: No value for user

Gil Carvalho
Ranch Hand

Joined: Dec 10, 2013
Posts: 55
Hi

I'm getting this error in my login and i don't know why

My php



My login.java



My JsonParser



and my Userfunctions



The errors i get



Any help please??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Post the JSON data that is being returned. Does it have data for "user"?


Ping & DNS - my free Android networking tools app
Gil Carvalho
Ranch Hand

Joined: Dec 10, 2013
Posts: 55
I don't know

When i put this in my php




The logCat gives me this



The problem is it seems that the response variable in php don't fill the JSonObject "user"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
So the problem is in the PHP code somewhere...?
Gil Carvalho
Ranch Hand

Joined: Dec 10, 2013
Posts: 55
Hi

Maybe, but i don't know where.
The query works since the first if after the query works, i put a acho there.
The problem is the §response variable seems to don't get the variables, why?

Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
I'll move the question over to the PHP forum.
 
Consider Paul's rocket mass heater.
 
subject: org.json.JSONException: No value for user
 
Similar Threads
Unrecognized Property in fetching data from JSONObject in Jersey web service
Multi-threading Android
connect tandroid to mysql using php to insert new records
Unable to fetch correct json string
Undefined index