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


html¿¡¼­ ÀÔ·ÂÇѰª DB¿¡¼­ ¹Þ¾Æ¿À±â (µµ¼­Á¤º¸ °Ë»ö)
9³â Àü
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();
?>
ÃßõÃßõ : 636 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,651
ÀÚ¹Ù½ºÅ©¸³Æ® Base64 encode, decode
2,650
PHP ¹®ÀÚ¿­ °ü·Ã ÇÔ¼ö
2,649
[php] ¹®ÀÚ¿­À» ³ª´©°Å³ª ÇÕÄ¡´Â explode, implode ÇÔ¼ö
2,648
php ¹®ÀÚ¿­ ÀÚ¸£±â ³ª´©±â ºÐ¸®Çϱâ - explode() , split()
2,647
DB Á¢±Ù ¹× Äõ¸®¹®(insert,select,update,delete)
2,646
[MySQL] Çʵ忡¼­ ƯÁ¤¹®ÀÚ Æ÷ÇÔ ¶Ç´Â Á¦¿ÜÇÑ DB °Ë»ö, LIKE ,NOT
2,645
php5 mysqli µðºñ Á¢¼Ó Ŭ·¡½º ÇÁ·Î±×·¥ ¹× »ç¿ë¹ý
2,644
PHP ¹®ÀÚ¿­ ³ª´©±â - explode()
2,643
[PHP] ¹è¿­ Array
2,642
php ¹è¿­
2,641
[php] Array() ¹è¿­À̶õ?
2,640
PHP ¹è¿­ ÇÔ¼ö Á¤¸®
2,639
PHP ±âº»ÀûÀÎ ¹è¿­ »ç¿ë¹ý
html¿¡¼­ ÀÔ·ÂÇѰª DB¿¡¼­ ¹Þ¾Æ¿À±â (µµ¼­Á¤º¸ °Ë»ö)
2,637
SQL Äõ¸® Á¤¸®
2,636
[MySql]DB¿¡¼­ ¼­·Î ´Ù¸¥ Å×À̺íÀÇ µ¥ÀÌÅ͸¦ Çѹø¿¡ ºÒ·¯¿À±â
2,635
jquery checkbox Àüü ¼±ÅÃ, Àüü ÇØÁ¦, üũ °ª ÃßÃâ
2,634
php set time limit ÇÔ¼ö - ŸÀӾƿô ¼³Á¤
2,633
Setting .htaccess to allow PHP to be accessed with .xml extension
2,632
jQuery API: Manipulation, Events, Effects, Internals, Utilities
2,631
´Ù¿î·Îµå Ƚ¼ö Á¦ÇÑ ½ºÅ©¸³Æ®
2,630
ÀÚ¹Ù½ºÅ©¸³Æ® ŸÀÌ¸Ó - setTimeout, setInterval, clearInterval ÇÔ¼ö
2,629
jQuery AJAX ·Î±×ÀÎ ±¸Çö
2,628
PHP ¼¼¼Ç ·Î±×ÀÎ ±¸Çö
2,627
PHP ÄíŰ ·Î±×ÀÎ ±¸Çö
2,626
jQuery¿¡¼­ json º¯¼ö »ç¿ë(Ȱ¿ë)¹ý
2,625
AJAX ¹Ýº¹Ã³¸® ¹× ¼³¸í ¿¹Á¦
2,624
[Android] Intent Ȱ¿ë ¿¹½Ã
2,623
[php] ¹è¿­À» ÀÓÀÇÀÇ ¼ø¼­·Î ¼¯´Â shuffle ÇÔ¼ö
2,622
jQuery API - ¼Ó¼º(CSS), ÃßÃâ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æÄ§
Copyright ¨Ï musictrot All rights reserved.