3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <head><title>Glycine max gene</title> </head> <body> <center> <p align="center">&nbsp;</p> <p align="center"><b><span style="font-size:18pt;">Glycine max gene</span></b></p> <hr></p></p> <? date_default_timezone_set('UTC'); $limit = 40; // 한 화면에 보여지는 재학생 행(레코드)수 if(!$now) { $now = 1; // 현재 페이지 번호 초기화 } $connect = mysql_connect("localhost", "root", "rhkddj12"); mysql_select_db("ust", $connect); if($Locus_name == null) { $sql = "select * from gmax_info order by Locus_name"; } else { $sql = "select * from gmax_info where Locus_name like '%$Locus_name%'"; } $result = mysql_query($sql, $connect); $total = mysql_num_rows($result); // 전체 재학생 행(레코드) 수 $total_page = (int)($total/$limit); if($total%$limit) { // 나머지가 있으면 $total_page++; // 전체 페이지 수 1 증가 } $start = ($now-1)*$limit; if($Locus_name == null) { $sql1 = "select * from gmax_info order by Locus_name limit $start, $limit"; } else { $sql1 = "select * from gmax_info where Locus_name like '%$Locus_name%' limit $start, $limit"; } $result1 = mysql_query($sql1, $connect); echo "<table border=1 bordercolor='#0033FF' align=center>"; echo "<tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description"; while($row = mysql_fetch_array($result1)) { echo "<tr>"; echo "<td> $row[Locus_name] </td>"; echo "<td> $row[Transcript_name] </td>"; echo "<td> $row[Gene_name] </td>"; echo "<td> $row[Description] </td>"; echo "</tr>"; } echo "</table>"; for($i=1; $i<=$total_page; $i++) { if($i == $now) { echo("[$i]"); // 현재 페이지는 링크 안함 } else { echo (" <a href = hapmap_search_gene.php?now=$i&Locus_name=$Locus_name>[$i] </a>"); } } ?> </center> </body> </html>
Output for 7.0.0 - 7.1.0
<html> <head><title>Glycine max gene</title> </head> <body> <center> <p align="center">&nbsp;</p> <p align="center"><b><span style="font-size:18pt;">Glycine max gene</span></b></p> <hr></p></p> Notice: Undefined variable: now in /in/TrmAc on line 12 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/TrmAc:16 Stack trace: #0 {main} thrown in /in/TrmAc on line 16
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<html> <head><title>Glycine max gene</title> </head> <body> <center> <p align="center">&nbsp;</p> <p align="center"><b><span style="font-size:18pt;">Glycine max gene</span></b></p> <hr></p></p> Notice: Undefined variable: now in /in/TrmAc on line 12 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/TrmAc on line 16 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /in/TrmAc on line 17 Notice: Undefined variable: Locus_name in /in/TrmAc on line 18 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /in/TrmAc on line 23 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /in/TrmAc on line 24 Notice: Undefined variable: Locus_name in /in/TrmAc on line 32 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /in/TrmAc on line 38 <table border=1 bordercolor='#0033FF' align=center><tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /in/TrmAc on line 43 </table> </center> </body> </html>
Output for 5.4.34 - 5.6.28
<html> <head><title>Glycine max gene</title> </head> <body> <center> <p align="center">&nbsp;</p> <p align="center"><b><span style="font-size:18pt;">Glycine max gene</span></b></p> <hr></p></p> Notice: Undefined variable: now in /in/TrmAc on line 12 Fatal error: Call to undefined function mysql_connect() in /in/TrmAc on line 16
Process exited with code 255.
Output for 4.3.0 - 5.4.32
<html> <head><title>Glycine max gene</title> </head> <body> <center> <p align="center">&nbsp;</p> <p align="center"><b><span style="font-size:18pt;">Glycine max gene</span></b></p> <hr></p></p> <? date_default_timezone_set('UTC'); $limit = 40; // 한 화면에 보여지는 재학생 행(레코드)수 if(!$now) { $now = 1; // 현재 페이지 번호 초기화 } $connect = mysql_connect("localhost", "root", "rhkddj12"); mysql_select_db("ust", $connect); if($Locus_name == null) { $sql = "select * from gmax_info order by Locus_name"; } else { $sql = "select * from gmax_info where Locus_name like '%$Locus_name%'"; } $result = mysql_query($sql, $connect); $total = mysql_num_rows($result); // 전체 재학생 행(레코드) 수 $total_page = (int)($total/$limit); if($total%$limit) { // 나머지가 있으면 $total_page++; // 전체 페이지 수 1 증가 } $start = ($now-1)*$limit; if($Locus_name == null) { $sql1 = "select * from gmax_info order by Locus_name limit $start, $limit"; } else { $sql1 = "select * from gmax_info where Locus_name like '%$Locus_name%' limit $start, $limit"; } $result1 = mysql_query($sql1, $connect); echo "<table border=1 bordercolor='#0033FF' align=center>"; echo "<tr><th>Locus_name<th>Transcript_name<th>Gene_name<th>Description"; while($row = mysql_fetch_array($result1)) { echo "<tr>"; echo "<td> $row[Locus_name] </td>"; echo "<td> $row[Transcript_name] </td>"; echo "<td> $row[Gene_name] </td>"; echo "<td> $row[Description] </td>"; echo "</tr>"; } echo "</table>"; for($i=1; $i<=$total_page; $i++) { if($i == $now) { echo("[$i]"); // 현재 페이지는 링크 안함 } else { echo (" <a href = hapmap_search_gene.php?now=$i&Locus_name=$Locus_name>[$i] </a>"); } } ?> </center> </body> </html>