C语言求助改错!!!谢谢!!

[复制链接]
查看11 | 回复1 | 2010-7-30 17:43:59 | 显示全部楼层 |阅读模式
#include
#include
#include
#include
#include
#include
int doSelect(int s,int t,int c,int o)
{

char $sql="select";

$sql=" ";

$sql=" from ";

if(c!="") $sql=" where ";
}
if((mysql_query(&db,$sql))!= 0)
//14行
{

fprintf(stderr,"Fail to query the db for information.\n");

return -1;
}
else
//19行

{
//返回数据

return 0;
};
int main()
{

doSelect('aa,bb','table1','id>5','id desc');

return;
}
错误提示:
lianjie2.c:14: error: expected identifier or ‘(’ before ‘if’
lianjie2.c:19: error: expected identifier or ‘(’ before ‘else’
请问我该怎么改?

回复

使用道具 举报

千问 | 2010-7-30 17:43:59 | 显示全部楼层
else
//19行
{ //返回数据
return 0; };后面那个分号不要
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行