第 3 行中的错误:以 $sql 开头
<?php
$sql = mysql_query("SELECT `sub_id` FROM `subject_studant` WHERE `std_id` = 2 ") or die mysql error();
while($row=mysql_fetch_assoc($sql))
{
$sub_id1 = $row['sub_id'];
echo $sub_id1;
}
?>