<? require_once('include/connect2.php'); $sql = "select * from student_on where id='33150'"; $dbq=mysql_query($sql) or die ("ไม่สามารถติดต่อฐานข้อมูลได้"); $numrow=mysql_num_rows($dbq); if($numrow > 0) { $i=1; while($i <= $numrow) { $result=mysql_fetch_array($dbq); $id=$result[id]; $name = $result[name]; ?> <table width="281" border="0" cellpadding="0" cellspacing="1"> <td width="7%" ><? echo $i ?></td> <td width="93%"><a href="show_student.php?id_edit=<?php echo $id?>"> <?php echo $name ?></a></td> </tr> </table> <? $i++; } } else echo"ไม่มีรายชื่อนักเรียน"; ?>
<? $id_edit=$_GET[id_edit]; include("include/connect2.php"); $strSQL = "SELECT * FROM student_on where id= '".$_GET["id_edit"]."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); ?> <img src="Studphoto/ <? $n1 = id; $n2 = $objResult["id"]; $n3 = "$n1$n2"; echo "$n3"; ?>" >