3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fecha = date('Y-m-j'); $ayer = strtotime ( '-1 day' , strtotime ( $fecha ) ) ; $ayer = date ( 'Y-m-j' , $ayer ); $hacedias = strtotime ( '-8 day' , strtotime ( $fecha ) ) ; $hacedias = date ( 'Y-m-j' , $hacedias ); $consulta = "SELECT date_format(fecha,'%d %M') AS FECHA, round((SUM(`TotalMinutos`)/60),1) FROM reporte WHERE ingeniero ='". $_SESSION['id']."' AND fecha BETWEEN '$hacedias' AND '$ayer' GROUP BY fecha"; $rs = mysql_query($consulta,$conexion); if(mysql_num_rows($rs)!=0) { ?> <p></p> <p></p> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100"> <tr> <?php $i = 0; while ($reg=mysql_fetch_array($rs)){ if($i == 8){ echo "</tr><tr>"; $i = 0; } ?> <td width="100"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="150"> <tr> <td width="80"><B><?=$reg['FECHA']; ?></B></td> </tr> <tr> <td width="80"><?=$reg['round((SUM(`TotalMinutos`)/60),1)']; ?> Horas</td> </tr> </table> </td> <?php $i++; } ?> </tr> </table> <p> <?PHP } else { echo "<h3><p style='color:#FF0000'> ATENCION!!! <br> No has registrado tus tiempos en los ultimos 5 dias.</p></h3>"; } ?> </table>
Output for 7.0.0 - 7.3.0rc4
Notice: Undefined variable: _SESSION in /in/U0SfO on line 9 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/U0SfO:10 Stack trace: #0 {main} thrown in /in/U0SfO on line 10
Process exited with code 255.
Output for 5.0.4 - 5.6.28
Notice: Undefined variable: _SESSION in /in/U0SfO on line 9 Fatal error: Call to undefined function mysql_query() in /in/U0SfO on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: _SESSION in /in/U0SfO on line 9 Fatal error: Call to undefined function mysql_query() in /in/U0SfO on line 10
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: _SESSION in /in/U0SfO on line 9 Notice: Undefined variable: conexion in /in/U0SfO on line 10 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /in/U0SfO on line 10 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /in/U0SfO on line 12 <h3><p style='color:#FF0000'> ATENCION!!! <br> No has registrado tus tiempos en los ultimos 5 dias.</p></h3> </table>