ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


html¿¡¼­ ÀÔ·ÂÇÑ°ª DB¿¡¼­ ¹Þ¾Æ¿À±â (µµ¼­Á¤º¸ °Ë»ö)
8³â Àü
book_search.html(µµ¼­Á¤º¸)
book_insert.php
book_list.php


1. book_search.html(µµ¼­Á¤º¸)  (html¿¡¼­ µµ¼­Á¤º¸ ÀÔ·Â)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>µµ¼­°Ë»ö</title>
</head>
<body>
<p><h3>µµ¼­Á¤º¸ °Ë»öÇϱâ</h3></p>
<form action='book_search.php' method='post'>
  <select name='searchtype'>
    <option value='title'>µµ¼­¸í</option>
    <option value='author'>ÀúÀÚ</option>
    <option value='publisher'>ÃâÆÇ»ç</option>
    <option value='isbn'>ÀϷùøÈ£</option>
  </select>
  <br/>
  <input type='text' name='searchterm' size='40'/>
  <input type='submit' value='°Ë»ö' />
  </form>

</body>
</html>

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




2. book_search.php (html¿¡¼­ ÀÔ·ÂÇÑ°ª DB¿¡¼­ ºÒ·¯¿Í¼­ php·Î »Ñ·ÁÁÖ±â
  
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<?
$connect = mysql_connect("localhost","wooin","1234");
$db_con=mysql_select_db("wooin_db",$connect);
$query = "select * from book where ".$searchtype." like '%".$searchterm."%'";
$result = mysql_query($query, $connect);
$records = mysql_num_rows($result); // mysql_num_rows ÀÎÀÚÀÇ ·¹ÄÚµå °³¼ö¸¦ ¾Ë·ÁÁØ´Ù
$fields=mysql_num_fields($result); // mysql_num_fieldsÀÎÀÚÀÇ Çʵ尳¼ö¸¦ ¾Ë·ÁÁØ´Ù
echo "<p> °ü·Ãµµ¼­¸¦ ".$records."°³ ã¾Ò½À´Ï´Ù.</p>";
$number=1;
?>

<h2> µµ¼­Á¤º¸ °Ë»ö°á°ú</h2>
<table width ="800" border="1" cellspacing="0" cellpadding="5">
<tr align="center">
<td bgcolor="#cccccc">¼ø¹ø</td>
<td bgcolor="#cccccc">µµ¼­¸í</td>
<td bgcolor="#cccccc">ÀúÀÚ</td>
<td bgcolor="#cccccc">ÃâÆÇ»ç</td>
<td bgcolor="#cccccc">ÁÖ¼Ò</td>
<td bgcolor="#cccccc">°¡°Ý</td>
<td bgcolor="#cccccc">ÀϷùøÈ£</td>
</tr>
<?
for($i =0; $i < $records; $i++){

echo"<tr align='center'>>";
echo"<td>$number </td>";
for($j=0; $j< $fields; $j++){
$data = mysql_result ($result, $i, $j); // ·¹ÄÚµåÀ§ ƯÁ¤À§Ä¡¿¡ ÀúÀåµÈ °ªÀ» °¡Á®¿Â´Ù
echo "<td> $data</td>";
}
echo"<tr>";
$number++;
}
mysql_close();
?>
ÃßõÃßõ : 483 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,645
php set time limit ÇÔ¼ö - ŸÀӾƿô ¼³Á¤
2,644
Setting .htaccess to allow PHP to be accessed with .xml extension
2,643
jQuery API: Manipulation, Events, Effects, Internals, Utilities
2,642
´Ù¿î·Îµå Ƚ¼ö Á¦ÇÑ ½ºÅ©¸³Æ®
2,641
ÀÚ¹Ù½ºÅ©¸³Æ® ŸÀÌ¸Ó - setTimeout, setInterval, clearInterval ÇÔ¼ö
2,640
jQuery AJAX ·Î±×ÀÎ ±¸Çö
2,639
PHP ¼¼¼Ç ·Î±×ÀÎ ±¸Çö
2,638
PHP ÄíÅ° ·Î±×ÀÎ ±¸Çö
2,637
jQuery¿¡¼­ json º¯¼ö »ç¿ë(È°¿ë)¹ý
2,636
AJAX ¹Ýº¹Ã³¸® ¹× ¼³¸í ¿¹Á¦
2,635
[Android] Intent È°¿ë ¿¹½Ã
2,634
[php] ¹è¿­À» ÀÓÀÇÀÇ ¼ø¼­·Î ¼¯´Â shuffle ÇÔ¼ö
2,633
jQuery API - ¼Ó¼º(CSS), ÃßÃâ
2,632
DIV ¿µ¿ªÀÇ À§Ä¡ ÁöÁ¤ÇÏ´Â ¹æ¹ý°ú ½ºÅ©·Ñ - Àý´ëÀ§Ä¡(absolute), »ó´ëÀ§Ä¡(relative), °íÁ¤À§Ä¡(fixed)
2,631
urlencode(), base64 encode() ÇÔ¼ö
2,630
PHP·Î IE¹öÀü üũÇÏ´Â ¹æ¹ý(Trident°ª»ç¿ë)
2,629
HTML5 °ü·Ã À¯¿ëÇÑ ·¹ÆÛ(ÂüÁ¶) »çÀÌÆ®
2,628
[HTML5] Video & Audio
2,627
HTML5 ¿Àµð¿À °î ¸ñ·Ï Àç»ý
2,626
HTML5 ¿Àµð¿À 404 ¿À·ù½Ã ´Ù¸¥ ÆÄÀÏ Àç»ý
2,625
HTML5 ¿Àµð¿À À̺¥Æ®¸®½º³Ê onerror
2,624
JavaScript Audio °´Ã¼
2,623
HTML5 Audio 2ä³Î Àç»ý
2,622
HTML5 Audio 2ä³Î Àç»ý + Àç»ý¿Ï·á ¸®½º³Ê
2,621
HTML5 À½¾Ç º¼·ý Á¶Àý
2,620
HTML5 À½¾Ç º¼·ý Á¶Àý
2,619
HTML5 ¿Àµð¿À ÀÚµ¿Àç»ý
2,618
HTML5 ¿Àµð¿À ¹Ýº¹ Àç»ý
2,617
HTML5 ¿Àµð¿À À̺¥Æ®¸®½º³Ê
2,616
Ŭ¸¯ ÇѹøÀ¸·Î °íÀ¯ÁÖ¼Ò(URL) º¹»çµÇ°Ô ÇÏ´Â ¹æ¹ý
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.