Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\Documents and Settings\Administrator>mysql -u
mysql: option '-u' requires an argument
C:\Documents and Settings\Administrator>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 4.0.22-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use appledb;
Database changed
mysql> show tables;
+-------------------+
| Tables_in_appledb |
+-------------------+
| aaa |
| bd_02 |
| bd_3 |
| board |
| board1 |
| member |
| memo |
| mymemo |
+-------------------+
8 rows in set (0.00 sec)
mysql> desc member;
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| num | int(11) | | PRI | NULL | auto_increment |
| userid | varchar(20) | | UNI | | |
| userpass | varchar(20) | | | | |
| question | varchar(150) | | | | |
| answer | varchar(50) | | | | |
| username | varchar(30) | | | | |
| email | varchar(50) | | | | |
| jumin | varchar(13) | | | | |
| tel | varchar(20) | | | | |
| zip | varchar(7) | | | | |
| address | varchar(50) | | | | |
| job | varchar(50) | | | | |
| hobby | varchar(50) | | | | |
+----------+--------------+------+-----+---------+----------------+
13 rows in set (0.04 sec)
mysql>
*** index.html
New Document
|
¸Þ´º
óÀ½À¸·Î
ȸ¿ø°¡ÀÔ
°Ô½ÃÆÇ
¸Þ¸ðÀå
|
ºä
if(!$mode){
$mode="home";
}
switch($mode){
case "home": include "null.html";
break;
case "board": include "../board0/list.html";
break;
case "memo": include "..memo/memolist.html";
break;
case "join": include "regist.html";
break;
}
?>
|
***regist.html
***regist.php
//ÆÄÀϸí: memberdb.php
/*
¾ÆÀ̵ð : userid
ºñ¹Ð¹øÈ£: userpass
ºñ¹Ð¹øȣȮÀÎ:
ºñ¹Ð¹øÈ£Áú¹®:question
Áú¹®´äº¯: ansewr
À̸§: name
À̸ÞÀÏ : jumin
ÁֹιøÈ£: jumin
ÀüȹøÈ£ : tel
ÇÚµåÆù:
ÁÖ¼Ò: address
Á÷¾÷: job
Ãë¹Ì: hobby
*/
echo "userid --- $userid
";
echo "userpass --- $userpass1
";
echo "question --- $question
";
echo "answer --- $answer
";
echo "username --- $username
";
echo "email --- $email
";
$jumin=$jumin1 . $jumin2;
echo "jumin --- $jumin
";
$tel=$tell . "-" . $tel2 . "-" . $tel3;
echo "tel --- %tel
";
$zip=$zip1 . "-" . $zip2;
echo "zip --- $zip
";
echo "address --- $address
";
$totaladdress=$zip . "/" . $address;
echo "totaladdress --- $totaladdress
";
echo "job --- $job
";
echo "hobby --- $hobby
";
include "connect.php";
$query="insert into member values(NULL, '$userid','$userpass1','$question','$answer','$username','$email','$jumin','$tel','$zip','$totaladdress','$job','$hobby')";
$resulut=mysql_query($query);
if($result){
echo "ÀԷ¼º°ø";
}else{
echo "ÀԷ½ÇÆÐ";
}
/*
$query="create table member(
num int not null auto_increment primary key,
userid varchar(20) not null unique,
userpass varchar(20) not null ,
question varchar(150) not null,
answer varchar(50) not null,
username varchar(30) not null,
email varchar(50) not null,
jumin varchar(13) not null,
tel varchar(20) not null,
zip varchar(7) not null,
address varchar(50) not null,
job varchar(50) not null,
hobby varchar(50) not null);"
$result=mysql_query($query);
if($result){
echo "Å×ÀÌºí »ý¼º ¼º°ø";
}else{
echo "Å×ÀÌºí »ý¼º ½ÇÆó";
}
*/
?>
***memberdb.php
//ÆÄÀϸí: memberdb.php
/*
¾ÆÀ̵ð : userid
ºñ¹Ð¹øÈ£: userpass
ºñ¹Ð¹øȣȮÀÎ://
ºñ¹Ð¹øÈ£Áú¹®:question
Áú¹®´äº¯: ansewr
À̸§: username
À̸ÞÀÏ : email
ÁֹιøÈ£: jumin
ÀüȹøÈ£ : tel
ÇÚµåÆù://
¿ìÆí¹øÈ£: zip
ÁÖ¼Ò: address
Á÷¾÷: job
Ãë¹Ì: hobby
*/
/*
echo "userid --- $userid
";
echo "userpass --- $userpass1
";
echo "question --- $question
";
echo "answer --- $answer
";
echo "email --- $email
";
$jumin=$jumin1 . $jumin
";
echo "jumin --- $userpass1
";
$tel=$tell . "-" . $tel2 . "-" . $tel3;
echo "tel --- %tel
";
$zip=$zip1 . "-" . $zip2;
echo "zip --- $zip
";
echo "address --- $address
";
$totaladdress=$zip . "/". $address;
echo "job --- $job
";
echo "hobby --- $hobby
";
*/
include "connect.php";
$query="create table member(
num int not null auto_increment primary key,
userid varchar(20) not null unique,
userpass varchar(20) not null ,
question varchar(150) not null,
answer varchar(50) not null,
username varchar(30) not null,
email varchar(50) not null,
jumin varchar(13) not null,
tel varchar(20) not null,
zip varchar(7) not null,
address varchar(50) not null,
job varchar(50) not null,
hobby varchar(50) not null)";
$result=mysql_query($query)or die(mysql_error());
if($result){
echo "Å×ÀÌºí »ý¼º ¼º°ø";
}else{
echo "Å×ÀÌºí »ý¼º ½ÇÆó";
}
?>
2004 12 16 php½ºÅ͵ð
¼Ò½ºÀÚ¼¼Á¤È®ÇÏ°Ôº¸±â
http://www.6VJ.com/php/php1216.txt