$chart = mysql_query("select sname, snumber, result from student"); while ($row = mysql_fetch_row($chart)) { $one = $row[0]; $two = $row[1]; $three = $row[2]; echo "$one $nbsp"; echo "$two $nbsp"; echo "$three $nbsp<br>"; $a = mysql_query("select type, num from pie"); if ($row[2]<0) { echo "BAD : $nbsp$nbsp $row[0]<br> "; $q1 = "update stuednt set type = 'bad' where sname = '". $row[0] ."'"; $result = mysql_query($ql); if ($result) echo "success<br>"; } if ($row[2] < 4 && $row[2] >= 0) { echo "OUT : $nbsp$nbsp $row[0]<br> "; $q1 = "update stuednt set type = 'out' where sname = '". $row[0] ."'"; $result = mysql_query($ql); if ($result) echo "success<br>"; } if ($row[2] < 10 && $row[2] >= 4) { echo "MID : $nbsp$nbsp $row[0]<br> "; $q1 = "update stuednt set type = 'mid' where sname = '". $row[0] ."'"; $result = mysql_query($ql); if ($result) echo "success<br>"; } if ( $row[2] >= 10) { echo "STAR : $nbsp$nbsp $row[0]<br> "; $q1 = "update stuednt set type = 'star' where sname = '". $row[0] ."'"; $result = mysql_query($ql); if ($result) echo "success<br>"; } }
student 테이블 안에서 result필드값을 비교해서 type 필드안에 update문을 써서 문자를 집어 넣으려고 하는데 안됩니다...
도와주세요 형님들!