½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
css
mysql
html
jquery
������
image
mobile
API
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 59 | Á¶È¸¼ö 4,598 | µî·ÏÀÏ 2002-07-31 22:54:51

´Ð³×ÀÓ

HappyCGI

À̸ÞÀÏ

hero@happycgi.com

Á¦¸ñ

Re: DB ¸ÖƼ°Ë»öÀ» ÇÏ·Á°í Çϴµ¥..
³»¿ë
[quote:a177d9b224="lotus74"]¾È³çÇϼ¼¿ä.

±×¾ß¸»·Î Á×À»¸ÀÀÔ´Ï´Ù. -_-;

PERL°ú msql ¿¬µ¿ÇÏ¿© »ç¿ëÁßÀÌ¿¹¿ä..

¿ì¸®°¡ ÈçÈ÷ º¸´Â °Ë»öÇϱ⿡¼­
¸ÖƼ°Ë»öÀ» ÇÏ·Á°í ÇÕ´Ï´Ù.
talbe¿¡¼­
»óÅ°¡ *(¸ðµÎ),A,B,B,DÀÎ °æ¿ì¿¡ ´ëÇØ ¸ÖƼ°Ë»öÀ»ÇÏ·Á±¸¿ä.
¿¹Àü¿¡´Â radio¹öÆ°À» »ç¿ëÇÏ¿© ÇÑ°¡Áö °æ¿ì¿¡¸¸ °Ë»öÀ» Çß¾ú´Âµ¥
checkbox¸¦ »ç¿ëÇÏ¿© ¿©·¯°æ¿ì¿¡ ´ëÇØ °Ë»öÀÌ °¡´ÉÇÏ°Ô ÇÏ·Á±¸¿ä.

±×·±µ¥..
º»·¡ÀÇ cgi¼Ò½º¸¦ º¸¾Æµµ ¸ð¸£°Ú°í..
°ü·ÃµÈ ¼Ò½º¸¦ ãÀ» ¼öµµ ¾ø³×¿ä.

°£´ÜÇÑ ÆÁÀÌ¶óµµ ÁÖ½Ã¸é °¨»çÈ÷ ¹Þ°Ú½À´Ï´Ù.[/quote:a177d9b224]


ÇØÇÇCGI ÀÔ´Ï´Ù.

perlÀ» ÀÌ¿ëÇÏ½Å´Ù´Ï ¹Ý°©½À´Ï´Ù.  ¿Õ¿ôÀ½~

°£´ÜÇÑ ¿¹Á¦¸¦ µé¾îº¸°Ú½À´Ï´Ù.


[ÇÁ·Î±×·¥ÄÚµå]
select * from test_DB where name like 'ÇÏÀÌ%' ;



À§ ¿¹Á¦´Â test_DB Áß name Ä÷³¿¡¼­ ÇÏÀÌ ¿Í ºñ½ÁÇÑ°ÍÀ» ã¾Æ¶óÁÒ (¾Æ½Ã°ÚÁö¸¸)

ÆÞÀ» ¾²½Å´Ù¸é ¾Æ¸¶ ¾Æ·¡¿Í À¯»çÇÑ ¹®¹ýÀ» ¾²½Ç°Çµ¥¿ä.


[ÇÁ·Î±×·¥ÄÚµå]
$sth = $dbh->prepare("select * from test_DB where name like 'ÇÏÀÌ%' ");



üũ¹Ú½ºÀÇ name °ªÀ» ¿¹¸¦ µé¾î A,B,C¶ó°í ÇÕ´Ï´Ù.
±×¸®°í A ¿¡ °ªÀ» a, BÀÇ °ªÀ» b,CÀÇ °ªÀ» c ¶ó°í °¡Á¤Çϱ¸¿ä.
A´Â À̸§Çʵå(name), B´Â ³ªÀÌÇʵå(age),C´Â Ãë¹ÌÇʵå(hobby)¶ó°í °¡Á¤ÇÕ´Ï´Ù.
$a ´Â AÀÇ °ªÀÎ a¸¦ ,$b´Â BÀÇ °ªÀÎ b¸¦ ,$c ´Â CÀÇ °ªÀÎ c ¶ó°í °¡Á¤Çϱ¸¿ä.


¸¸¾à »ç¿ëÀÚ°¡ A,B¸¦ ¼±ÅÃÇß´Ù¸é(¶Ç ´Ù¸¥ ¹æ¹ýÀ¸·Îµµ ok)
±×¸®°í °Ë»ö´Ü¾î°¡ ÇØÇÇCGI ¶ó¸é ¾Æ·¡ ó·³ ¹®¹ýÀÌ µÇ¾î¾ß °Ú½À´Ï´Ù.


[ÇÁ·Î±×·¥ÄÚµå]
if ($a) {
$a_search = " name like '%ÇØÇÇCGI%' or ";
}
if ($b) {
$b_search = " age like '%ÇØÇÇCGI%' or ";
}
if ($c) {
$c_search = " hobby like '%ÇØÇÇCGI%' ";
}

$sth = $dbh->prepare("select * from test_DB where $a_search $b_search $c_search  ");

$sth->execute();




À§ ó·³ ÇÏ°Ô µÇ¸é °£´ÜÈ÷ ¸ÖƼÄ÷³ÀÇ °Ë»öÀÌ µÇ°ÚÁö¿ä?

´Ù¸¥ ¹æ¹ýµµ ¸¹°ÚÁö¸¸ (¿¹¸¦ µé¸é °¢ A,B,CÀÇ name°ªÀ» ´Ù½Ã º¯¼ö·Î Àâ¾Æ¼­ Äڵ带 ´õ °£´ÜÈ÷ ¸¸µå´Â ¹æ¹ý)

Á¦ÀÏ ¹«½ÄÇÏ°Ô ¸¸µé¾î ºÃ½À´Ï´Ù.  ¶¡~

$a_search ,$b_search , $c_search °¡ ¸ðµÎ ¾ø´Â °æ¿ì¿¡´Â ¹®¹ý¿À·ù°¡ ³ª°ÚÁö¿ä?

ÆÞ·Î °£´ÜÈ÷ ¸·À¸½Ã¸é µÉ°Í °°±¸¿ä.

ÁÁÀº ÇÏ·çµÇ¼¼¿ä.
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û DB ¸ÖƼ°Ë»öÀ» ÇÏ·Á°í Çϴµ¥.. 2002-07-30 21:48:59
´ÙÀ½°Ô½Ã±Û Æ÷·³¾È¿¡¼­ ¶Ç Æ÷·³ 2002-08-01 09:09:27