Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Excel To HTML using codebeautify.org</title>
- </head>
- <body>
- <?php
- echo "Iniciando<br>";
- echo "Iniciando Connection()";
- $server="localhost";
- $user="hid1728660_h22stein";
- $pass="hvo123";
- $db="id1728660_medidor";
- $connection = mysql_connect($server, $user, $pass);
- echo "Error: " . mysql_error();
- mysql_select_db($db) or die( 'MySQL ERROR: '. mysql_error() );
- echo "Abrindo conexao...<br>";
- echo "Conectado.<br>Executando query...<br>";
- $result=mysql_query("SELECT * FROM `Dados Arduino` ORDER BY `timeStamp` DESC",$connection);
- if ( !empty( $err = mysql_error() ) ) {
- echo $err;
- } else {
- echo "Query executada com sucesso.";
- }
- ?>
- <table border="2" cellspacing="1" cellpadding="0">
- <tr>
- <td align='center' width='160px'>
- <b> Tensão </b>
- </td>
- <td align='center' width='160px'>
- <b> Corrente </b>
- </td>
- <td align='center' width='160px'>
- <b> Tempo1 </b>
- </td>
- <td align='center' width='160px'>
- <b> Tempo2 </b>
- </td>
- <td align='center' width='160px'>
- <b> Horario </b>
- </td>
- </tr>
- <?php
- if($result!==FALSE){
- while($row = mysql_fetch_array($result)) {
- printf("
- <tr>
- <td align='center'> %s </td>
- <td> %s </td>
- <td> %s </td>
- <td> %s </td>
- <td> %s </td>
- </tr>",
- $row["timeStamp"], $row["Tensao"], $row["Corrente"], $row["Tempo1"], $row["Tempo2"], $row["Horario"]);
- }
- mysql_free_result($result);
- mysql_close();
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement