<title> 학생 레코드 저장 </title>
<body>
<center>
<?php
// name : insert-st.php
import_request_variables("GPC");
$conn = mysql_connect('localhost', 'root', '123456');
mysql_query("SET NAMES euckr");
mysql_select_db('education', $conn);
$sql = "insert into student (scode, sname, sdept, sphone) ";
$sql = $sql . " values ('$scode', '$sname', '$sdept', '$sphone')";
$result = mysql_query($sql, $conn);
$result = mysql_query("select * from sutdent where sname = '$sname'", $conn);
echo "저장된 학생 레코드 ---> <br><br> \n";
while ( $row = mysql_fetch_array($result) ) {
echo "학번: " . $row[scode] . "<br>\n";
echo "이름: " . $row[sname] . "<br>\n";
echo "학과: " . $row[sdept] . "<br>\n";
echo "전화: " . $row[sphone] . "<br>\n";
}
mysql_free_result($result);
mysql_close($conn);
?>
</center>
</body>
</html>
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\APM_Setup\htdocs\Rich\insert-st.php on line 26
진하기한부분에 문제가있는듯
알려주세요 ..
따로 입력받는폼은 따로있습니다. 그것도올려드릴께여