JSONException: el valor <br del tipo java.lang.String no se puede convertir a JSONArray

Sé que este tipo de problema tiene algunas soluciones y aplicó algunas soluciones para este problema, pero no puedo resolverlo y estoy confundido. Por favor, ayúdame. Aquí está el código:

protected String doInBackground(Boolean... params) {

        String result = null;

        StringBuilder sb = new StringBuilder();


        try {

            // http post
            HttpClient httpclient = new DefaultHttpClient();



            HttpGet httppost = new HttpGet(
                    "http://192.168.2.245/getProducts.php?login=1&user_name=UserName&password=Password");  

            HttpResponse response = httpclient.execute(httppost);
            if (response.getStatusLine().getStatusCode() != 200) {
                Log.d("MyApp", "Server encountered an error");
            }



            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    response.getEntity().getContent(), "utf-8"), 8); //old charset iso-8859-1

            sb = new StringBuilder();

            sb.append(reader.readLine() + "\n");

            String line = null;

            while ((line = reader.readLine()) != null) {

                sb.append(line + "\n");


            }
            result = sb.toString();

            Log.d("test", result);

        } 
        catch (Exception e) {

        Log.e("log_tag", "Error converting result " + e.toString());

        }

        return result;
    }

CÓDIGO PHP:

$login=$_GET["login"]; 
$user_name=$_GET["user_name"]; 
$password=$_GET["password"]; 
$output=array(); 
if ($login) { 
$sql=mysql_query("SELECT user_id FROM users WHERE user_name='".$user_name."' AND user_pass='".$password."' "); 

while($row=mysql_fetch_array($sql)) { 
 $user_id=$row["user_id"]; 
} 

$sql=mysql_query("SELECT name,device_id,lat,lon FROM devices WHERE user_id='".$user_id."' LIMIT 100"); 

while($row=mysql_fetch_assoc($sql)) { 
$output[]=$row; } 
} 

print(json_encode($output)); 
mysql_close();

El logcat: org.json.JSONException: Value

¿Qué tengo que hacer? El código Php se ejecuta en la página web sin ningún error, pero ¿por qué se produjo un error en esta parte? En logcat también tiene: (!) Aviso: Variable no definida: id_usuario en C: \ wamp \ www \ getProducts.php en línea27

Logcat!

<br /><font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0'    cellpadding='1'><tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined variable: user_id in C:\wamp\www\getProducts.php on line <i>27</i></th></tr><tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>... this kind of code appears in logcat then org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONArray at org.json.JSON.typeMismatch(JSON.java:107)

Respuestas a la pregunta(1)

Su respuesta a la pregunta