[ÇнÀ°úÁ¤]-----------------
-¸Þ¸ðÀ常µé±â(ÀÔ·Â,DB¿¬°á)
-For¹® (¹Ýº¹¹®È°¿ë)
----------------------------
:::¸Þ¸ðÀ常µé±â::::::::::::::::::: ---memolist.html-------------
¹øÈ£ |
À̸§ |
À̸ÞÀÏ |
¸Þ¸ð | include connect.php; $query=select * from mymemo; $result=mysql_query($query,$connect); while($row=mysql_fetch_row($result)){ echo
$row[0] |
$row[1] |
$row[2] |
$row[3] | ; } ?>
¸Þ¸ðÀÔ·Â
---memoinput.html-------------------------------
echo ³Ñ¾î¿ÂÀ̸§ --- $name ; echo ³Ñ¾î¿Â¸ÞÀÏ --- $email ; echo ³Ñ¾î¿Â¸Þ¸ð --- $memo ; $connect=mysql_connect(localhost,apple,1234); $db=mysql_select_db(appledb,$connect);
$query=insert into mymemo values(NULL,$name,$email,$memo);
$result=mysql_query($query,$connect);
if($result){ echo µ¥ÀÌŸ ÀԷ¼º°ø!; }else { echo µ¥ÀÌŸ ÀԷ½ÇÆÐ!; }
echo
?>
:::¹Ýº¹¹®::::::::::::::::::::::::::: ---for.php-------------------------
$su=0; for($i=1;$i<=10;$i++){ $sum+$i//echo hello --- $i ; } echo sum --=$sum; ?>
---forlist.php---------------
include connect.php;
$query=select count(*) from mymemo; $result=mysql_query($query,$connect);
$data=mysql_num_row($result);
echo data --- $data ; $cnt=mysql_fetch_row($result); $cnt
for($i=0;$i<10;$i++){ $row=mysql_fetch_row($result); echo $row[0] ---$row[1] --- $row[2] ---$row[3] ; } ?>
--------------------------------
php ½ºÆ®µð 2004 11 25
¼Ò½ºÀÚ¼¼È÷º¸±â
(»ó´Ü¸Þ´º´Â À¥¿¡¼ º¸¿©ÁÜÀ¸·Î ¿¡·¯ºÎºÐÀÌ ÀÖ½À´Ï´Ù)
http://www.6VJ.com/php/php1125.txt
http://www.6VJ.com/php/php1125.html
|