에러 질문이요 ㅜ
본문
도대체 이게 왜 안되는거죠? 500에러 뜨고 출력이 안되네요 ㅜ
1 | 도대체 이게 왜 안되는거죠? 500에러 뜨고 출력이 안되네여;; |
<?php $con = mysql_connect( "localhost" , "test" , "pass" ); mysql_select_db( "textdb" , $con ); mysql_query( "set names utf8" ); $number_of_orders = mysql_query( "SELECT COUNT(*) FROM T_content" ); $number_of_orders = mysql_fetch_array( $number_of_orders ); $num_1 = mt_rand(1, $number_of_orders [0]-7); $num_2 = mt_rand(1, $number_of_orders [0]-7); $num_3 = mt_rand(1, $number_of_orders [0]-7); $view_1_1 = mysql_query( "SELECT text_line FROM T_content where no=$num_1" ); $view_1_1 = mysql_fetch_array( $view_1_1 ); $view_1_2 = mysql_query( "SELECT text_line FROM T_content where no=$num_1+1" ); $view_1_2 = mysql_fetch_array( $view_1_2 ); $view_1_3 = mysql_query( "SELECT text_line FROM T_content where no=$num_1+2" ); $view_1_3 = mysql_fetch_array( $view_1_3 ); $view_1 = $view_1_1 [text_line]. $view_1_2 [text_line]. $view_1_3 [text_line]; $view_2_1 = mysql_query( "SELECT text_line FROM T_content where no=$num_2" ); $view_2_1 = mysql_fetch_array( $view_2_1 ); $view_2_2 = mysql_query( "SELECT text_line FROM T_content where no=$num_2+1" ); $view_2_2 = mysql_fetch_array( $view_2_2 ); $view_2_3 = mysql_query( "SELECT text_line FROM T_content where no=$num_2+2" ); $view_2_3 = mysql_fetch_array( $view_2_3 ); $view_2 = $view_2_1 [text_line]. $view_2_2 [text_line]. $view_2_3 [text_line]; $view_3_1 = mysql_query( "SELECT text_line FROM T_content where no=$num_3" ); $view_3_1 = mysql_fetch_array( $view_3_1 ); $view_3_2 = mysql_query( "SELECT text_line FROM T_content where no=$num_3+1" ); $view_3_2 = mysql_fetch_array( $view_3_2 ); $view_3_3 = mysql_query( "SELECT text_line FROM T_content where no=$num_3+2" ); $view_3_3 = mysql_fetch_array( $view_3_3 ); $view_3 = $view_3_1 [text_line]. $view_3_2 [text_line]. $view_3_3 [text_line]; <!DOCTYPE html> <html> <head> <meta charset= "UTF-8" > <title>Insert title here</title> </head> <body> echo $view_1 ; echo $view_2 ; echo $view_3 ; </body> </html> ?> |
답변 2
html 태그는 출력문(echo ...)으로 감싸서 내보내야 해요~
echo "<!DOCTYPE html>"; 이런식으로요~
echo "<!DOCTYPE html>"; 이런식으로요~
?> <---------------------------추가
<!DOCTYPE html>
~
~
<?
echo
$view_1
;
echo
$view_2
;
echo
$view_3
;
?>
</html>
?> <---------------- 삭제
답변을 작성하시기 전에 로그인 해주세요.