没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include <stdio.h>
#include <stdlib.h>
#include "libpq-fe.h" /* libpq header file */
int
main()
{
char state_code[3]; /* holds user state code */
char query_string[256]; /* holds constructed SQL query */
PGconn *conn; /* holds database connection */
PGresult *res; /* holds query result */
int i;
conn = PQconnectdb("dbname=test"); /* connect to the database */
if (PQstatus(conn) == CONNECTION_BAD) /* did the connection fail? */
{
fprintf(stderr, "Connection to database failed.\n");
fprintf(stderr, "%s", PQerrorMessage(conn));
exit(1);
}
printf("Enter a state code: "); /* prompt user for a state code */
scanf("%2s", state_code);
sprintf(query_string, /* create an SQL query string */
"SELECT name \
FROM statename \
WHERE code = '%s'", state_code);
#include <stdlib.h>
#include "libpq-fe.h" /* libpq header file */
int
main()
{
char state_code[3]; /* holds user state code */
char query_string[256]; /* holds constructed SQL query */
PGconn *conn; /* holds database connection */
PGresult *res; /* holds query result */
int i;
conn = PQconnectdb("dbname=test"); /* connect to the database */
if (PQstatus(conn) == CONNECTION_BAD) /* did the connection fail? */
{
fprintf(stderr, "Connection to database failed.\n");
fprintf(stderr, "%s", PQerrorMessage(conn));
exit(1);
}
printf("Enter a state code: "); /* prompt user for a state code */
scanf("%2s", state_code);
sprintf(query_string, /* create an SQL query string */
"SELECT name \
FROM statename \
WHERE code = '%s'", state_code);
资源评论
幻影大哥
- 粉丝: 3
- 资源: 100
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 指南针罗盘PSD图设计图
- Python毕业设计-基于深度学习LSTM的情感分析京东商城数据(源码+文档).zip
- Python毕业设计-基于机器学习的商品评论情感分析源码+全部数据(个人高分项目).zip
- Python毕业设计项目-基于机器学习的商品评论情感分析项目源码+数据集+训练好的模型+GUI界面,(从淘宝爬取评论).zip
- 对格力工厂内劳动妇女的调查问卷
- 毕业设计&课设-基于机器学习的商品评论情感分析-毕业设计项目.zip
- 2024-05-14-22-09-40.mkv
- Citizens with Props 1.0
- 基于java实现的画图程序设计.zip
- 【学生课程实验】基于Springboot的大学生就业招聘系统【源码+lw+部署文档+讲解】
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功