2011-11-18 2 views
0

여기 내 코드입니다 :은, PHP 내 텍스트 영역 상자에 표시

<textarea> 
<? 
while ($row = mysql_fetch_array($result)) { 
    echo $row[0], $row[1] . "\n"; 
    ?> 
</textarea> 

그리고 두 번째 상자 텍스트 영역 상자에이를 출력 및 작성

<? 
while ($row = mysql_fetch_array($result)) { 
    echo $row[0], $row[1] . "\n"; 
    ?> 
긴 태그와

과 중괄호, 이제 나는 이것을 얻는다! 하하 :

<br /> 
<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'> 
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>(!)</span> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\globaldetroit\index.php on line <i>23</i></th></tr> 
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr> 
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr> 
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0006</td><td bgcolor='#eeeeec' align='right'>672248</td><td bgcolor='#eeeeec'>{main}()</td><td title='C:\wamp\www\globaldetroit\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>0</td></tr> 
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0037</td><td bgcolor='#eeeeec' align='right'>679240</td><td bgcolor='#eeeeec'><a href='http://www.php.net/mysql_fetch_array' target='_new'>mysql_fetch_array</a> 
()</td><td title='C:\wamp\www\globaldetroit\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>23</td></tr> 
</table></font> 

SQL 코드에서 "ordered by"문을 제거하면이 오류가 사라집니다.

+2

당신은 여전히 ​​하나의 텍스트 영역에서 전체 데이터베이스 내용을 편집 아이디어를 당기는 것 같다. 내가 네 아버지라면 ... –

+1

전체 웹 사이트가 그 오류 메시지처럼 보일 때 누군가 기억 나니? – Herbert

답변

7

이 시도, 짧은 태그는 서버에서 사용할 수 있습니다 :

<?php 
while ($row = mysql_fetch_array($result)) { 
echo $row[0], $row[1] . "\n"; 
?> 

편집 :

당신이 while 루프 닫는 } 누락 :

<?php 
while ($row = mysql_fetch_array($result)) 
{ 
    echo $row[0], $row[1] . "\n"; 
} 
?> 
+0

잘 작동하는 것처럼 보였습니다. 이제는 다음과 같습니다. 구문 분석 오류 : 예상치 못한 $ end of C : \ wamp \ www \ globaldetroit \ index.php on line 34 –

+0

내 편집 내용을 참조하십시오. –

+0

Oh와 Hi Jake는 다른 Jake 출신입니다. –

1

중 short_open_tag를 설정되어 있지 않거나 PHP가 실행 중이 아닙니다.

1

봅니다 :

<textarea> 
<?php 
while ($row = mysql_fetch_array($result)) { 
    echo $row[0], $row[1] . "\n"; 
} 
?> 
</textarea> 
관련 문제