ivanhalen

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: Getting Started code have problem #87410
    ivanhalen
    Participant
    ivanhalen
    Participant

    I had the same problem (maybe you notice that it happens only with JSON data)

    Here's what I've done:

    1. Opening directly in the browser the “example.php” page gave me the same error with a couple of warning about “undefined index”: something like:

      Notice: Undefined index: sord in D:\Web\php\demo\example.php on line 27

      Warning: Division by zero in D:\Web\php\demo\example.php on line 45
      Couldn t execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

    2. I added a querystring to see if the file was working (the page needs some input data to initialize it):
      http://path_to_file/example.php?page=1&rows=10
      well, the JSON data was there, at the bottom of the page, but still had the “undefined index” notifications: then I started thinking that these notifications could be bad for the “example.html” page to read JSON data…
    3. I suppressed all the warning and notifications adding the line:
      ini_set('display_errors', 0);
      at the top of the example.php page: it works!!!

    So, for me the key was to use the script as in a production environment, without warning and displaying errors: hope it can help!

Viewing 2 replies - 1 through 2 (of 2 total)

Stay connected with us in your favorite flavor!