:::MySQL:::::::::::::::::::::::::
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\Documents and Settings\Administrator>cd..

C:\Documents and Settings>cd..

C:\>cd \mysql -u apple -p
ÁöÁ¤µÈ °æ·Î¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù.

C:\>cd \mysql -u root -p
ÁöÁ¤µÈ °æ·Î¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù.

C:\>cd \mysql -u root -p
ÁöÁ¤µÈ °æ·Î¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù.

C:\>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.0.22-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
mysql>
mysql>
mysql>
mysql>

mysql> create database appledb;
Query OK, 1 row affected (0.09 sec)

mysql> grant all on appledb. * to apple@localhost identified by '1234';
Query OK, 0 rows affected (0.16 sec)

mysql> exit
Bye

C:\>mysql -u apple -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.0.22-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> c

:::¸Þ¸ðÀåÀÛ¾÷¼Ò½º-¼öÁ¤:::::::::::::::::::::::::::
---¸Þ¸ðÀ帮½ºÆ®--------------------------------
***memolist.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>
<table border=1 width=500>
<tr>
<td>¹øÈ£</td>
<td>À̸§</td>
<td>À̸ÞÀÏ</td>
<td>¸Þ¸ð</td>
<td>¼öÁ¤</td>

</tr>
<?
include "connect.php";
$query="select * from mymemo";
$result=mysql_query($query,$connect);
while($row=mysql_fetch_row($result)){
echo"<tr>
<td>$row[0]</td>
<td>$row[1]&nbsp;</td>
<td>$row[2]&nbsp;</td>
<td>$row[3]&nbsp;</td>
<td><a href=memodifry.html?num=$row[0]>¼öÁ¤</a></td>
</tr>";
}
?>
</table>
<br>
<!--<a href="memo.html">¸Þ¸ðÀÔ·Â</a>-->
<a href="memoinput.html">¸Þ¸ðÀÔ·Â</a>
</BODY>
</HTML>

---¼öÁ¤-----------------------------------
***memodifry.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>
<?
echo "³Ñ¾î¿Â ±Û¹øÈ£ --- $num<br>";
include "connect.php";
$query="select * from mymemo where num='$num'";
$result=mysql_query($query,$connect);
$row=mysql_fetch_array($result);
?>

<br>
<form method=post action=memomodifry.php?num=<?echo $row[num];?>>
<table border=1 width=500>

<tr>
<td>À̸§</td>
<td><input type=text name=name value=<?echo$row[1];?>></td>
</tr>
<tr>
<td>À̸ÞÀÏ</td>
<td><input type=text name=email value=<?echo$row[2];?>></td>
</tr>
<tr>
<td>¸Þ¸ð</td>
<td><input type=text name=memo value=<?echo$row[3];?>> <size=50></td>
</tr>

<tr>
<td colspan=2 align=center>
<input type=submit value=Àü¼Û>&nbsp;&nbsp;&nbsp;
<input type=reset value=Ãë¼Ò>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>

---ÀÔ·Â----------------------------
***memoinput.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>

<br>
<form method=post action=memoinput.php>
<table border=1 width=500>

<tr>
<td>À̸§</td>
<td><input type=text name=name></td>
</tr>
<tr>
<td>À̸ÞÀÏ</td>
<td><input type=text name=email></td>
</tr>
<tr>
<td>¸Þ¸ð</td>
<td><input type=text name=memo size=50></td>
</tr>

<tr>
<td colspan=2 align=center>
<input type=submit value=Àü¼Û>&nbsp;&nbsp;&nbsp;
<input type=reset value=Ãë¼Ò>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>


---DB¿¬°á--------------------------
***connect.php
<?
$connect=mysql_connect("localhost","apple","1234");
$db=mysql_select_db("appledb",$connect);
?>
::::::::::::::::::::::::::::::::::::::::::::



PHP ½ºÅ͵ð 2004 11 26

ÀÚ¼¼È÷º¸±â: http://www.6VJ.com/php/php1126.txt
http://www.6VJ.com/php/php1126.html