3v4l.org

run code in 300+ PHP versions simultaneously
<? 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>"); } } ?>
Output for 4.3.1 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<? 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>"); } } ?>
Output for 8.0.13
Warning: Undefined variable $now in /in/CShe1 on line 4 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/CShe1:8 Stack trace: #0 {main} thrown in /in/CShe1 on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6, 7.4.33
Notice: Undefined variable: now in /in/CShe1 on line 4 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/CShe1:8 Stack trace: #0 {main} thrown in /in/CShe1 on line 8
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/CShe1:8 Stack trace: #0 {main} thrown in /in/CShe1 on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Notice: Undefined variable: now in /in/CShe1 on line 4 Fatal error: Call to undefined function mysql_connect() in /in/CShe1 on line 8
Process exited with code 255.
Output for 4.3.0

Process exited with code 137.

preferences:
262.82 ms | 401 KiB | 358 Q