Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

CÓïÑÔ Mysql ÒÉÎÊ

if(mysql_init(&mysql)==NULL)
{
sprintf(ErrMsg,"We are outof Memory");
return(false);
}

if(!mysql_real_connect(&mysql,"localhost","test","test","test",3306,NULL,0))
{
sprintf(ErrMsg,"Connect to DB failed Error Code: %d",mysql_errno(&mysql));
return(false);
}else
{
return(true);
}
// now we connected

//µ±ÔÚ³ÌÐòÖ´Ðе½ÕâÀïµÄʱºò£¬¼ÙÈçmysqlµ±ÁË£¬ÏÂÃæµÄÓï¾äÖ´ÐÐʱ¾Í³öÏÖ±ÀÀ££¬ºÜÓпÉÄÜÔ­À´µÄmysql½á¹¹¾ÍÐèÒªÖØÐÂÉú³É
// ÎÊÌâÊÇÈçºÎÈ¥ÅÐ¶Ï mysql½á¹¹ÊÇ·ñÐèÒªÖØ¹¹ÄØ£¿ ÔõôȥÅÐ¶Ï mysqlÊÇ·ñ»¹Á¬½Ó×Å£¬ÎÒÏ£ÍûʵÏֵŦÄÜÊdzÌÐòµ½Ò»°ë£¬mysqlµ±ÁË£¬È»ºómysqlÖØÆôÁË£¬³ÌÐòÄܹ»×Ô¶¯ÔÙÁ¬½Ó²éѯ£¬¸ßÊÖ¸øµã½¨Òé


          if(mysql_ping(&mysql)==0)
  {
char sql[1024];
sprintf(sql,"INSERT INTO `test3`(`a`,`b`,`c`)\
VALUES('%d','%d','%d')",a1,b1,c1);

if(mysql_query(&mysql,sql))
{sprintf(ErrMsg,"Error: %s",mysql_error(&mysql));
return(false);
}else

{
   

return(true);

}

  }



Äܲ»Äܲ¶×½Òì³£Ö®ÀàµÄ

²»ÖªµÀÄã˵µÄ±ÀÀ£ÊÇʲôÒâ˼£¬Èç¹ûÊdzÌÐò³¹µ×Òì³£Í˳öÁË£¬ÄǾÍÒª¿´¿´¿âÊDz»ÊÇÕýÈ·µÄ¡£
<


Ïà¹ØÎÊ´ð£º

ѧϰÌÖÂÛ C/C++ QQȺ - C/C++ / ·Ç¼¼ÊõÇø

QQȺ 29152388
ÓÑÇéUP

°ï¶¥

up

°ïup

up Ö§³Ö£¡

up jf

...ÄѵÀÓзÖ..?

up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£

Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ

¼ÓÁË¡£

¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......

CÈí¼þ תÕý¹¤×ʶàÉÙºÏÊÊ£¿

µØµãÔÚÉîÛÚÄÏɽ
¡¡¡¡×öCÈí¼þ¡£ÊÔÓÃ2K£¬²»ÖªµÀתÕý¸ø¹«Ë¾Ì¸¶àÉÙºÏÊʰ¡£¿
¡¡¡¡ÁíÍ⣬±¾ÈËС±¾£¬Ó¢ÓïÁù¼¶£¬ÊÔÓÃÈý¸öÔ±íÏÖµÃÒ²ËãÖÐÉÏˮƽ¡£µ«ÊÇÏÖÔÚ»¹²»ÄÜ×öÏîÄ¿¡£ÁíÍâ±ÏҵѧУûÓÐÃûÆø¡£
¡¡¡¡×ªÕý¸ø¹«Ë¾Ì¸¶àÉ ......

ÓÃC»òC++ÈçºÎ±àдÇó½â3Dħ·½³ÌÐò - C/C++ / C++ ÓïÑÔ

ÇëÎÊÓÃC»òC++ÈçºÎ±àдÇó½â3Dħ·½µÄ³ÌÐò£¬¸Ã´ÓºÎ¿ªÊ¼£¿
лл¸÷룬°ïæÌáµã½¨Òé°É¡£

http://www.mofang.net/code/176/182/6581.html

ÎÒÖ»ÄÜÍ»ÆÆ60Ã룡°¦¡£

ÎÒ¸Õ¹ý40Ãë

googleµÄandroidÖÐÓиöOpenGL ES + ......

c,c++Á¬½Ómysql ÕÒ²»µ½Í·²¿Îļþ£¨ÐÂÊÖ£©

±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ