database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 2070 게시물 읽기
No. 2070
# php에서 mysql에 안써져요????
작성자
정익
작성일
2000-06-13 17:20
조회수
3,048

먼저 사용자를

mysql>insert into user values('localhost','user',password('password'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N');

만들고

 

mysql>insert into db values('localhost','dbname','user','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

 

이렇게 만들고

 

create table info(id varchar(30);name varchar(30);tel varchar(30));

 

테이블을 생성하고나서

 

input.html파일을

 

<html>

<head>

<title>php 첫번째 테스트</title>

</head>

<body>

<center>

<form action="input.php3" method="post">

<h1>신규회원 가입신청서</h1>

<br><br>

<h3>개인정보를 입력하십시오</h3>

<table>

<tr>

<td> 아이디</td>

<td> <input type="text" name="id" size="30"></td>

</tr>

<tr>

<td> 이 름</td>

<td> <input type="text" name="id" size="30"></td>

</tr>

<tr>

<td> 전 화</td>

<td> <input type="text" name="id" size="30"></td>

</tr>

<tr>

<td colspan=2 align=center>

<input type="submit" value="신청"><input type="reset" value="지우기">

</td>

</tr>

</table>

</center>

</body>

</html>

----------------------------------------------------------------

input.php3 파일을

 

<?

if(!$name){

echo("<script>

windows.alert('이름을 넣으세요')

history.go(-1)

</script>

");

 

exit;

}

 

$connection = mysql_connect("localhost","myuser","myuser");

 

mysql_select_db("myuserdb",$connection);

$dbresult=mysql_quary("insert into info values('$id', $name', '$tel')", $connection);

 

if($dbresult=="")

{

echo("

<script>

window.alert('데이터 입력오류!!!')

history.go(-1)

</script>

");

exit;

}

?>

 

로 하고 웨브라우저에서 실행시키면

 

일단 에러는 안보입니다.

 

하지만 mysql에 가서

 

select * from info

 

하면 비어 있다고 나옵니다.

 

아시는 분 알려 주세요

[Top]
No.
제목
작성자
작성일
조회
2080MySQL에서 같은 DB내의 TABLE을 이름이 다른 TABLE로 복사하는 방법???
dreamy
2000-06-13
2976
2086┕>Re: MySQL에서 같은 DB내의 TABLE을 이름이 다른 TABLE로 복사하는 방법???
정재익
2000-06-14 01:20:52
3270
2093 ┕>Re: Re: MySQL에서 같은 DB내의 TABLE을 이름이 다른 TABLE로 복사하는 방법???
dreamy
2000-06-14 16:36:28
3221
2078(급함!!) Solaris에서 MySQL 서버를 자동 시작 및 종료하는 방법은?
김병완
2000-06-13
3008
2071auto_increment에 대해서...
장석규
2000-06-13
3154
2077┕>Re: auto_increment에 대해서...
정재익
2000-06-13 18:29:21
3530
2070# php에서 mysql에 안써져요????
정익
2000-06-13
3048
2076┕>Re: # php에서 mysql에 안써져요????
정재익
2000-06-13 18:26:02
3342
2069[질문] MySQL 데몬이 시간이 지나면 자주 죽습니다..
정성훈
2000-06-13
3015
2075┕>Re: [질문] MySQL 데몬이 시간이 지나면 자주 죽습니다..
정재익
2000-06-13 18:22:49
3255
2068# mysql RPM ./configure 에러
김현
2000-06-13
3269
2074┕>Re: # mysql RPM ./configure 에러
정재익
2000-06-13 18:21:44
3458
2065# my SQL+PHP+APACHE make ; make install 에러
김현
2000-06-13
3057
2073┕>Re: # my SQL+PHP+APACHE make ; make install 에러
정재익
2000-06-13 18:19:40
3246
2083 ┕># Re: Re: # my SQL make ; make install 에러
김현
2000-06-14 00:02:36
3082
2084┕># Re: # my SQL make ; make install 에러
김현
2000-06-14 00:05:08
3221
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.029초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다