½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
javascript
PHP
ASP
CSS
mysql
HTML
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 25 | Á¶È¸¼ö 502 | µî·ÏÀÏ 2000-11-21 11:01:47

´Ð³×ÀÓ

Anonymous

À̸ÞÀÏ

Á¦¸ñ

[´äº¯] pgsql¹®¹ý ¾Ë°í½Í¾î¿ä
³»¿ë
#include
#include
#include
#include

void db_connection()
{
conn = PQsetdb(NULL,NULL,NULL,NULL,"exam"); //examÀ̶ó´Â db¿¡ ¿¬°á
if (PQstatus(conn) == CONNECTION_BAD){
printf("error : %s", PQerrorMessage(conn));
}
}

main()
{
db_connection();

PGresult *result,*result1;
char query[200],query1[200];
int row,i;
=============== aaa¶ó´Â Å×ÀÌºí¿¡ °ª Áý¾î³Ö±â =====================
sprintf(query, "insert into aaa(a01,a02,a03,a04)
values (1,
asdf
,
qwer
,
sadf
)");
result = PQexec(conn, query);

============= aaa¶ó´Â Å×À̺íÀÇ °ª »Ñ·ÁÁÖ±â ======================

sprintf(query1, "select a01,a02,a03,a04 from aaa");
result1 = PQexec(conn, query1);
row = PQntuples(result1); // °Ë»öÇÑ µ¥ÀÌŸÀÇ ÁÙ¼ö(?)

printf("Content-Type:text/html

");
printf("
");
printf("
");
printf("
");
printf("
");
printf("
");
printf("
");
printf("
");
for (i = 0; i < row; i++){
printf("
");
printf("
", PQgetvalue(result1, i, 0));
printf("
", PQgetvalue(result1, i, 1));
printf("
", PQgetvalue(result1, i, 2));
printf("
", PQgetvalue(result1, i, 3));
printf("
");
}
printf("
¹øÈ£ÀÚ·á4ÀÚ·á2ÀÚ·á3
%s%s%s%s

");

}

insert, select ó·³ delete, update µÎ ±ÛÄÉ »ç¿ëÇÏ¸é µË´Ï´Ù...

delete from aaa where a01=3

ÀÌ·±½ÄÀ¸·Î ³ÖÀ¸¸é aaaÅ×ÀÌºí¿¡¼­ a01ÀÌ 3ÀÎ Çุ Áö¿ì°Ô ÇÏ´Â °ÍÀ̱¸..

update aaa set a01=2, a02=
ruru
, a03=
cucu
, a04=
tutu
where a01=3

ÀÌ·±½ÄÀ¸·Î ³ÖÀ¸¸é aaaÅ×ÀÌºí¿¡¼­ a01ÀÌ 3ÀÎ Çุ ¼öÁ¤Çϴ°ű¸¿©

Áú¹®¿¡ ¸Â´Â ´äÀÎÁö Àß ¸ð¸£°Ú³×¿©...

±×³É ÁÖ¼¶ ÁÖ¼¶ ÀûÀº°Å¶ó¼­ Ʋ¸±ÁöµÎ ¸Ö¶ó¿©...

Áñ°ÇÇÏ·ç µÇ¼¼¿©
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û À¥Àü¹®±³À°... ¾îµð¼­ ¹è¿ö¾ßÇϴ°ÅÁã? -- 2000-11-21 10:23:56
´ÙÀ½°Ô½Ã±Û [Áú¹®] CGIµî·Ï¿¡..´ëÇØ.. Ãʺ¸¿¡¿ä^^;;; 2000-11-21 14:10:20