Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/11/2013, 16:15
MrBay88
 
Fecha de Ingreso: noviembre-2013
Mensajes: 8
Antigüedad: 10 años, 5 meses
Puntos: 0
Respuesta: Json y librería highcharts

He cometido un fallo al transcribir el código aquí. En el servidor lo tengo subido correctamente. Tal y como muestro aquí. De ahí nuestro malentendido. Perdón.

El php del Json es así:

Código:
<?php
$con = mysql_connect("url", "user", "password");

if (!$con) {
die('Could not connect: ' . mysql_error());
}

mysql_select_db("nombre_base_datos", $con);

$result = mysql_query("SELECT Mes, Compras FROM nombre_de_la_tabla");


//Aquí es donde antes he puesto el error $row['Mes']=$r[0]
$rows = array();
while($r = mysql_fetch_array($result)) {
    $row[0] = $r[0];
    $row[1] = $r[1];
    array_push($rows,$row);
}


print json_encode($rows, JSON_NUMERIC_CHECK);

mysql_close($con);
?>