mysql_fetch_row 관련 질문입니다.ㅜㅜ
-
게시물 수정 , 삭제는 로그인 필요
아무리 찾아보고 고쳐봐도 안되요.ㅜㅜ
고수님들아 도와주세요.ㅠㅠ
<?
$conn = mysql_connect('localhost', 'root', 'apmsetup');
$db_status = mysql_select_db('TV');
if (!$db_status) {
error("DB_ERROR");
exit;
}
$query = "select * from program where price >= 1";
$result = mysql_query($query);
print "<table border=1><tr>" .
"<th>번호</th>" .
"<th>이름</th>" .
"<th>성별</th>" .
"<th>나이</th>" .
"<th>직업</th>" .
"<th>지역</th>" .
"<th>성향</th>" .
"<th>선호시간대</th></tr>";
while( $row = mysql_fetch_row($result) ) {
print "<tr><td>" . $row[0] . "</td>" .
"<td>" . $row[1] . "</td>" .
"<td>" . $row[2] . "</td>" .
"<td>" . $row[3] . "</td>" .
"<td>" . $row[4] . "</td>" .
"<td>" . $row[5] . "</td>" .
"<td>" . $row[6] . "</td>" .
"<td>" . $row[7] . "</td></tr>";
}
print "</table>";
?>
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\APM_Setup\htdocs\program3.phpon line 16
이런메세지가 나타납니다.
도와주세요~
아무리 찾아보고 고쳐봐도 안되요.ㅜㅜ
고수님들아 도와주세요.ㅠㅠ
<?
$conn = mysql_connect('localhost', 'root', 'apmsetup');
$db_status = mysql_select_db('TV');
if (!$db_status) {
error("DB_ERROR");
exit;
}
$query = "select * from program where price >= 1";
$result = mysql_query($query);
print "<table border=1><tr>" .
"<th>번호</th>" .
"<th>이름</th>" .
"<th>성별</th>" .
"<th>나이</th>" .
"<th>직업</th>" .
"<th>지역</th>" .
"<th>성향</th>" .
"<th>선호시간대</th></tr>";
while( $row = mysql_fetch_row($result) ) {
print "<tr><td>" . $row[0] . "</td>" .
"<td>" . $row[1] . "</td>" .
"<td>" . $row[2] . "</td>" .
"<td>" . $row[3] . "</td>" .
"<td>" . $row[4] . "</td>" .
"<td>" . $row[5] . "</td>" .
"<td>" . $row[6] . "</td>" .
"<td>" . $row[7] . "</td></tr>";
}
print "</table>";
?>
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\APM_Setup\htdocs\program3.phpon line 16
이런메세지가 나타납니다.
도와주세요~