3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "<table cellpadding = 10>"; echo '<tr>'; echo '<th>3D table</th>'; $c = 0; if ($c >= $cols) { echo '</tr>'; $c = 0; } $start = '2014-04-01'; $end = '2014-04-31'; //for ($x=0;$x<count($values);$x++) { $sql = "SELECT empName, date, timeIn FROM attendance WHERE date >= '$start' AND date <= '$end' GROUP BY empName ORDER BY empName ASC"; $searchQuery = mysql_query("SELECT date FROM attendance GROUP BY DAY(date) ORDER BY date DESC LIMIT 20") or die($searchQuery."<br/><br/>".mysql_error()); $nums = mysql_num_rows($searchQuery); $rQuery = mysql_query($sql) or die($rQuery . "<br/><br/>" . mysql_error()); $num = mysql_num_rows($rQuery); for($y = 0; $y < $num; $y++) { $row = mysql_fetch_array($rQuery); echo '<tr>'; echo '<td class="odd">'. $row['empName'] .'</td>'; for($i = 0; $i < $nums; $i++) { $rows = mysql_fetch_array($searchQuery); echo '<td class="even">'.$rows['date'].'</td>'; }echo $y; echo '</tr>'; }
Output for 7.0.0 - 7.1.0
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/9XYfY:16 Stack trace: #0 {main} thrown in /in/9XYfY on line 16
Process exited with code 255.
Output for 5.0.4 - 5.6.28
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Fatal error: Call to undefined function mysql_query() in /in/9XYfY on line 16
Process exited with code 255.
Output for 5.0.0 - 5.0.3
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Fatal error: Call to undefined function mysql_query() in /in/9XYfY on line 16
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /in/9XYfY on line 16 Warning: mysql_query(): A link to the server could not be established in /in/9XYfY on line 16 <br/><br/>Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
Output for 4.3.1
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /in/9XYfY on line 16 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/9XYfY on line 16 <br/><br/>Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
Output for 4.3.0
<table cellpadding = 10><tr><th>3D table</th> Notice: Undefined variable: cols in /in/9XYfY on line 7 </tr> Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/9XYfY on line 16 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/9XYfY on line 16 <br/><br/>Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)