Loading ...
Sorry, an error occurred while loading the content.

51475Re: inline cell edit - JSON parse error

Expand Messages
  • juliebonniedaisy
    Sep 2, 2009
      o.responseText will return whatever your ajax page is told to return, if you just want a JSON string the just return only that such as my echo does at the bottom:

      $SQL="SELECT UserID, CONCAT(LastName, ',', Firstname) AS FullName FROM Users ORDER BY LastName, FirstName";

      // prepare statement
      if ($stmt = $oConn->prepare($SQL)) {
      $stmt->execute() or die ("Could not execute statement"); // execute prepared statement

      $stmt->bind_result($UserID, $FullName);

      $arr = array();
      while ($r = $stmt->fetch()) {
      $arr[] = array("label" => $FullName);
      // $arr[] = array("value" => $UserID, "label" => $FullName);
      }
      echo "{ \"dropdownOptions\": " . json_encode($arr) . "}";
      $stmt->close(); // close statement
      }
    • Show all 5 messages in this topic