0) { $return_arr['success'] = "True"; $return_arr['count'] = mysqli_num_rows($sql); $row = array(); while ($row = mysqli_fetch_array($sql)) { $row['login_username'] = apiDecryptLoginEntry($row['login_username'], $api_key_decrypt_hash, $api_key_decrypt_password); $row['login_password'] = apiDecryptLoginEntry($row['login_password'], $api_key_decrypt_hash, $api_key_decrypt_password); $return_arr['data'][] = $row; } echo json_encode($return_arr); exit(); } else { $return_arr['success'] = "False"; $return_arr['message'] = "No resource (for this client and company) with the specified parameter(s)."; // Log any database/schema related errors to the PHP Error log if (mysqli_error($mysqli)) { error_log("API Database Error: " . mysqli_error($mysqli)); } echo json_encode($return_arr); exit(); }