Real time graphing with flot, mysql, php -
I am trying to attract a real time graph because my mysql table is being constantly inserted with values, As the moving graph is referenced, the value actually comes from a carbon dioxide sensor, which updates the value of the table with to 2 posts with id posts. I have changed his monastery. Random in the code below:
& lt; Php $ result = mysql_query ("SELECT * FROM node1 ORDER by id DESC LIMIT 1") or die (mysql_error ());; & Gt; & Lt ;? Php $ row = mysql_fetch_array ($ result) ;? & Gt; Var j = "& lt ;? php echo $ row ['co2'];? & Gt;"; Var next = "& lt ;? php echo $ row ['id'];? & Gt;"; (Var i = 0; i & lt; this.xscale - 1; i ++) {this.array [i] = [i, this.array [i + 1] [1]]; // (x, y)} this.array [this.xscale - 1] = [this.xscale - 1, j];
However, when I run this code, the first value changes, after which it remains constant, even if the last line in the table is updating. I have heard because in PHP, the server only voted once. That's why I'm getting constant reading of only the first figures. Is there a way in which I can update the graph of the last value of the table? With AJAX?
Thank you for your help
Yes, you can use or < / P>
Note that both these options may require considerable bandwidth.
Comments
Post a Comment