I’m constructing a url based on user input and defined variables which I’m passing to WWW in the attempt to have the user entered data added to a mysql database.
The url references a php file on the server which handles the db connection and data insertion. The constructed url seems fine, as if I use it in a browser the data is added correctly, but
data_post = WWW (url);
seems to do nothing, I’ve been over the highscores tut on the wiki and used similar logic (in fact have used the postscore function to try this) but the WWW call seems to not operate, it doesn’t exit with an error code.
just to make sure that its no error on the server side.
i personally never used a get request, i worked with the WWWForm class, look at the scripting reference, there are good examples. but i still don’t think that there is something wrong with your code on the unity side. You could also try EscapeURL on note, in case that is user input.
thanks, I tried the simple die php script on the server and WWW returns the string fine in unity, so the server seems ok.
So it seems that when the WWW call uses the full php string it is not returning anything. What is confusing me is that if I grab the url string that is constructed and paste it into a browser I get a result from the mysql db in the browser so I would assume that it should be returned to Unity.
Did you use WWWForm for retrieving data? I’ll look into that.
Update: I looked over the forming of the url and there was a problem, so it is returning the data to unity now. Half way there
What’s odd is that the push data php isn’t working, and again, if I take the url and paste it into a browser it inserts data in mysql.
note_post.data won’t return anything in this case as it isn’t getting anything back from the php on insertion, though I guess I could insert an echo just for checking.