data not saving into database <p>Hi In the below code data not saving into database.In the file I am working with android.client side data coming correctly. from client side I am passing username,password,groupname,friendusername it will return array list.</p> <p>Why I am not getting where i did mistake.</p> <p><strong>php</strong></p> <pre><code>case "CreateGroup": $userId = authenticateUser($db, $username, $password); if ($userId != NULL) { if (isset($_REQUEST['friendUserName'])) { $friendUserName = $_REQUEST['friendUserName']; $groupname = $_REQUEST['groupname']; $sql = "select Id from users where username='".$friendUserName."' limit 1"; if ($result = $db-&gt;query($sql)) { if ($row = $db-&gt;fetchObject($result)) { $requestId = $row-&gt;Id; $groupname = $row-&gt;Id; if ($row-&gt;Id != $userId) { $sql = "insert into group(providerId, requestId, groupname) values(".$userId.", ".$requestId.", ".$groupname.")"; echo $sql; if ($db-&gt;query($sql)) { $out = SUCCESSFUL; } else { $out = FAILED; } } else { $out = FAILED; } } else { $out = FAILED; } } else { $out = FAILED; } } else { $out = FAILED; } } else { $out = FAILED; } break; </code></pre>