Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no way of knowing what is wrong with your code, as we don't have the full picture. The fragments you have offered leave us with a partial picture. That said, here is how we can help:</p> <p>1.) Show us what makes up the Date_Queries() object. How is it making the request? Etc.</p> <p>2.) Show us the structure of the $response object.</p> <p><strong>3.) Print the Java request result to the console before attempting to parse it. Verify it's correct.</strong></p> <p>4.) Surround your Java in try/catch and print a stack trace so you can better evaluate any kind of errors.</p> <p>5.) Show us where you are setting result_code, and any other possible responses</p> <p>6.) Show us all relevant code</p> <p>7.) Show us all relevant code</p> <p>8.) Side note, you should use single quotes in php, ALWAYS, unless you know what you are doing... <code>$response['information'] = ...</code></p> <p>EDIT:</p> <hr> <p>According to your comment below, the issue you are having is that you are treating your response as an Array, instead of an Object... Please read the JSON spec:</p> <p><a href="http://www.json.org/" rel="nofollow">http://www.json.org/</a></p> <p>Array: [ 1, 2, 3, 4 ] Object: { "key1":"val1", "key2":"val2" }</p> <p>If you treat your base object as an object instead, it should stop throwing the exception it is currently throwing.</p> <p>You can use a parameter of <code>json_encode()</code> to ensure that all responses in arrays are converted to objects. The keys will be the array indices.</p> <p><code>json_encode($ob,JSON_FORCE_OBJECT);</code></p> <hr> <p>If the problem isn't with the outermost type of the response, check to ensure that other parts of it, such as "information", are in fact correct. For instance, <code>mysql_fetch_array</code> can return FALSE, which means it is not an array by the time it hits your Android app:</p> <p><a href="http://php.net/manual/en/function.mysql-fetch-array.php" rel="nofollow">http://php.net/manual/en/function.mysql-fetch-array.php</a></p> <hr> <p>Final note, you should stop using the mysql_* functions, and use PDOs instead.</p> <p><a href="http://us2.php.net/manual/en/book.pdo.php" rel="nofollow">http://us2.php.net/manual/en/book.pdo.php</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload