MySQLµÄcµ÷ÓÃ
1. ¸½¼ÓÏîÒ»¶¨ ¼ÓÉÏlibmysql.lib¡£
2. include Ò»¶¨¼ÓÉÏ mysqlµÄinclude£¨ÒòΪҪÅÜÕâ¹Ø¼üÒ»¾ä
#include <mysql.h>£©
3 lib Ò»¶¨¼ÓÉÏ mysqlµÄlib
ºÃÁËÏÂÃæÊÇʵÀýºÍphpº¯Êý»ù±¾Ò»ÑùµÄ¡£±¾È˲»¿ÉÄܸøÄã·ÒëÎĵµ£¬º¯Êý²»¶®×Ô¼º¿´¡£
#include
<windows.h>//ÓÃÕâ¸ö·½±ã£¬°üº¬winsock.hËùÒÔ°üº¬winsockÒ²¿ÉÒÔ
#include <iostream>
#include <mysql.h>
using namespace std;
int main( int argc, char * argv[] )
{
//ÕâÀàÐͱð´íÁË£¬¾ßÌå¿´Îĵµ
MYSQL mysql;
MYSQL *pdata;
MYSQL_RES
*result;
MYSQL_ROW
row;
char sqlcommand[80];
mysql_init(&mysql);//Ò»¸ö³õʼ»¯
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"Gamer");
//¿ØÖÆÁ´½ÓÐÐΪµÄ
pdata=mysql_real_connect(&mysql,"localhost","root","123456","gamer",0,NULL,0);
//Êý¾Ý¿âÁ´½Ó
if(pdata)
{
cout<<"connect
successful!!"<<endl;
}
if(mysql_select_db(pdata,"gamerdata"))
{
cout<<"select_db
successful!!"<<endl;
}
//È»ºóÑ¡ÔñÊý¾Ý¿âÁË£¬µ±È»ÓÃsqlÒ»Ñù£¬º¯Êý¿´×Å·½±ãµã
sprintf(sqlcommand,"select * from
gamerdata");
mysql_query(pdata,sqlcommand);
//Õâ¾ä¸ÉʲôµÄ²»ÓÃÎÒ·Ñ´½ÉàÁË
result =
mysql_use_result(pdata);
//»ñÈ¡¼Ç¼¼¯
row = mysql_fetch_row(result);
//°´Êý×鷽ʽ°ÑÊý¾Ý·Åµ½rowÖУ¬µ±Ç°ÐеÄ
//¿´ËùÓÐÐмӸöÑ»·¾ÍºÃ£¬Óαê×Ô¼º»áÅÜ£¬²»ÀÍ´ó¼Ò·ÑÐÄ¡£
cout<<row[1];
//¿ÉÒÔÊä³öÁË£¬´ó¹¦¸æ³É
mysql_close(pdata);
//±ðÍüÁË¿ªµÆ£¬ÍüÁ˹صÆ
}
Ïà¹ØÎĵµ£º
Ò»°ã¸³Ó踡µãÁеÄÖµ±»ËÄÉáÎåÈëµ½Õâ¸öÁÐËùÖ¸¶¨µÄÊ®½øÖÆÊý¡£Èç¹ûÔÚÒ»¸öFLOAT(8, 1)µÄÁÐÖд洢1. 2 3 4 5 6£¬Ôò½á¹ûΪ1. 2¡£Èç¹û½«ÏàͬµÄÖµ´æÈëFLOAT(8, 4) µÄÁÐÖУ¬Ôò½á¹ûΪ1. 2 3 4 6¡£Õâ±íʾӦ¸Ã¶¨Òå¾ßÓÐ×㹻λÊýµÄ¸¡µãÁÐÒÔ±ãµÃµ½¾¡¿ÉÄܾ«È·µÄÖµ¡£Èç¹ûÏ뾫ȷµ½Ç§·ÖÖ®Ò»£¬ÄǾͲ»Òª¶¨Òåʹ¸ÃÀà ......
windows7 + ubuntu9.10Ë«Æô¶¯,Õâ¸öÓÐÌ«¶àµÄÌû×ÓÁË,²»¹ýÕâ´ÎµÄÇé¿ö±È½Ï¸´ÔÓ.
ÏÈ×°µÄWIN7,ºó×°UBUNTU,ûÓÐÈκÎÎÊÌâ.GRUBË«Æô¶¯.
ºóÀ´ÒòΪһ¸öÇé¿ö,ҪװXP,°ÑWIN7×öÁË ghost.×°ÍêXP,GRUBµ±È»Ã»ÓÐÁË,ÓÚÊÇÓÃubuntuÆô¶¯ÅÌÐÞ¸´.
ËäÈ»Æô¶¯²Ëµ¥³öÀ´ÁË,µ«Ö»ÄܽøÐÐubuntu,½øÈëwindowsµÄʱºò¾ÍÌáʾerror:cannot get C/H/S value ......
/*************************************by
garcon1986*****************************************************/
¶à±í²éѯ£º
CREATE TABLE IF NOT EXISTS contact(
contact_id int(11) NOT NULL AUTO_INCREMENT,
user_name varchar(255),
nom varchar(255),
prenom varchar(255),
mail varchar(64),
passcode cha ......
As is Known to us,the function Main is the entry point of all programs.Therefore, we are usually neglecting all that we don't do,which makes us not understanding it more clearly.Now there is a sample arm program which will provide something that opration system usually do.
asm:
&nb ......
ǰÑÔ£º
±¾ÎIJûÊöµÄÊÇÒ»¿î¾¹ýÉú²ú»·¾³¼ìÑéµÄǧÍò¼¶Êý¾ÝÈ«ÎļìË÷£¨ËÑË÷ÒýÇæ£©¼Ü¹¹¡£±¾ÎÄÖ»Áгöǰ¼¸ÕµÄÄÚÈݽÚÑ¡£¬²»ÌṩȫÎÄÄÚÈÝ¡£
ÔÚDELL PowerEdge 6850·þÎñÆ÷£¨ËÄ¿Å64 λInter Xeon MP 7110N´¦ÀíÆ÷ / 8GBÄڴ棩¡¢RedHat AS4 Linux²Ù×÷ϵͳ¡¢MySQL 5.1.26¡¢MyISAM´æ´¢ÒýÇæ¡¢key_buffer=1024M»·¾³ÏÂʵ²â£¬µ¥±í1000ÍòÌõ¼Ç ......