欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當(dāng)前位置:主頁 > 軟件編程 > C語言 >

C連接Mysql數(shù)據(jù)庫代碼

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C語言|點(diǎn)擊: 次


復(fù)制代碼 代碼如下:
//vc工具中添加E:\WAMP\BIN\MYSQL\MYSQL5.5.8\LIB 路徑 
 //在工程設(shè)置-》鏈接》庫模塊中添加 libmysql.lib  
#include <stdio.h> 
#include <time.h> 
#include <string.h> 
#include <winsock.h> 
#include "E:\wamp\bin\mysql\mysql5.5.8\include\mysql.h" 
void main(){  
       MYSQL *conn;  
       MYSQL_RES *res;  
       MYSQL_ROW row;  
       char *server ="localhost";  
       char *user ="root";  
       char *password="";  
       char *database="test";  
       char sql[1024]="select * from chinaren";  
       conn=mysql_init(NULL);  

       if(!mysql_real_connect(conn,server,user,password,database,0,NULL,0)){  
               fprintf(stderr,"%s\n",mysql_error(conn));  
               exit(1);  
       }  

       if(mysql_query(conn,sql)){  
               fprintf(stderr,"%s\n",mysql_error(conn));  
               exit(1);  
       }  

       res=mysql_use_result(conn);  

       while((row = mysql_fetch_row(res))!=NULL){  
               printf("%s\n",row[2]);  
       }  

       mysql_free_result(res);  
       mysql_close(conn);  
}

上一篇:C/C++產(chǎn)生指定范圍和不定范圍隨機(jī)數(shù)的實(shí)例代碼

欄    目:C語言

下一篇:用位圖排序無重復(fù)數(shù)據(jù)集實(shí)例代碼(C++版)

本文標(biāo)題:C連接Mysql數(shù)據(jù)庫代碼

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/3913.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有