Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
mysql_query(conn,"SELECT abstract FROM papers limit 4 ");
我们可以在 C-api 的限制函数中使用变量吗?就像我必须迭代地提取 10 行,所以形式如下:mysql_query(conn,"SELECT abstract FROM pages limit $i $i+10");
你所寻求的是“偏移”
例如SELECT abstract FROM papers LIMIT 10 OFFSET 20 给出 10 个结果(跳过前 20 个)
SELECT abstract FROM papers LIMIT 10 OFFSET 20
参考:http ://dev.mysql.com/doc/refman/5.7/en/select.html
我通过使用字符串解决了上述问题。strcpy(查询,“从论文限制中选择摘要”);位置=0;sprintf(temp,"%d %d",pos,pos+100); strcat(查询,临时);
这样 pos 也可以用作迭代器。