½«Êý¾ÝдÈëmysql - C/C++ / CÓïÑÔ
cÓïÑÔ²Ù×÷mysqlÊý¾Ý¿â
¶¨ÒåÒ»¸öÕûÐͱäÁ¿a£»ÈçºÎ½«aµÄֵд»ØÊý¾Ý¿â
query = "update test.user set score=¡¯50¡® where id='lisi' ";
ÕâÑù¿ÉÒÔ µ«ÎÒÏ뽫50¸Ä³É±äÁ¿aµÄÖµ ¸ÃÔõôÐÞ¸Ä
ÓÑÇéÖ§³Ö,up~up~up~!!
char query[300];
snprintf(query,sizeof(query), "update test.user set score='%d' where id=\"%s\" " , a, "lisi" );
char query[300];
int score = 50;
char id[50] = "lisi";
sprintf(query, "update test.user set score='%d' where id='%s'" , score, id);
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
SHIFT¼ÓF10ÓëÄǸö¼üÓÒctrl±ßÉϵÄÄǸö¼ü¹¦ÄÜÒ»Ñù£¬ÏëÆÁÕâ¸ö
µ«²»ÖªÒªÔõôдÄǸö×éºÏ¼ü£¡
ÓÐûÄĸö´óÏÀ·ÅÒ»¶ÎÕâ¸öµÄ´úÂë»òдһ¶Î
http://topic.csdn.net/u/20090609/15/7dc9fb70-243f-4070-9cfd-34e48b66e6c6.html
......
ÎÒÒѾ°´Õս̳ÌÉÏÅäÖÃtomcatµÄserver.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿
2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......