mysql 셀렉트 검색에서 오류좀 봐주세요

kkndsky의 이미지

실행을 하면 검색할 글 번호가 주어지지 않았습니다 만떠요
필드에 데이터를 집어넣줘봐는데도 안되는데요.
시디파일 그대로 복사해서 아이디랑 비번 데이터베이스 연결 이거만고쳐는데요
데이터베이스는 테이블 책대로 고대로 따라넣엇구요.
어디가 문제인지 문제좀 집어주세욤

<? // view.php
$connect = mysql_connect('localhost','linux','linux') or die("데이터 베이스 연결 오류");
mysql_select_db('test',$connect);

if (!$idx) { echo ("검색할 글 번호가 주어지지 않았습니다."); exit; }

$que = "select * from notice where idx=$idx";
$result = mysql_query($que,$connect);
if (mysql_num_rows($result)<1) { echo ("해당 레코드가 존재하지 않거나 삭제되었습니다."); exit; }
$row = mysql_fetch_array($result);
$title = htmlspecialchars(stripslashes($row["title"]));
$body = htmlspecialchars(stripslashes($row["body"]));
$body = nl2br(ereg_replace(" ","&",$body));
?>
<html>
<head>
<link href="/main.css" rel="STYLESHEET" type="text/css">
</head>
<body leftmargin=10 topmargin=0>
<br>
<table border="0" width="500">
<tr>
<td width="200" class="text"><b>공지사항</b></td>
<td width="300" class="text" align="right">
<a href="list.php?page=<?=$page?>">[목록으로]</a></td>
</tr>
<tr>
<td colspan="2" valign="top">
<table border="1" cellspacing="0" width="500" bordercolorlight="#808080" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#e5ebe1" width="60" class="text" align="center">제 목</td>
<td width="260" class="text" align="center"><?=$title?></td>
<td bgcolor="#e5ebe1" width="60" class="text" align="center">작성일</td>
<td align=left width="120" class="text" align="center"><p><?echo($row["writetime"]);?></p></td>
</tr>
<tr>
<td bgcolor="#e5ebe1" class="text" align="center">내 용</td>
<td colspan="3" class="text"><?=$body?></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
[root@localhost htdocs]#
[root@localhost htdocs]#

세이군의 이미지

웹 브라우저 주소줄에 어떻게 입력을 하셨는지, 현재 서버의 환경은 어떠한지를 말해 주셔야 답변을 할 수 있습니다.

우선 이러한 경우를 살펴주세요..
PHP의 버전이 4.2 이상인지?
php.ini파일에서 register_globals 의 값이 On인지?
view.php를 호출할때 "?idx=아무번호"로 했는지?

DB에 접속해서

insert into test (idx, title,body) values (1, '시험용','test content');

를 입력하시고 웹 브라우저에서
view.php?idx=1
이라고 호출해보세요. 그리고 그 결과를 다시 올려주세요..
kkndsky의 이미지

php4.3.0이구요
mysql4.0.0
apache2.4
레드헷9.0 입니당

test db notice table 이구요

위에하라는데로
insert into notice(idx, title, body) values ( 2, '시험용' , ' test content');
ok
테이블 노티스고요 기존 1번생성하여서 2번으로생성했구요
http://localhost/view.php?idx=2
하였으나
검색할 글 번호가 주어지지 않았습니다." 이말이 한글로나왔던게 깨져서
aa°Ë»öÇÒ ±Û ¹øÈ£°¡ ÁÖ¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù. 이러케뜨내요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.