应该是odbc_num_field(resource result_id);
返回字段数,其中,result_id是由odbc_exec()的到的
odbc_num_rows(int result_id)返回符合你的查询条件的记录数,值是-1说明没有符合条件的
返回字段数,其中,result_id是由odbc_exec()的到的
odbc_num_rows(int result_id)返回符合你的查询条件的记录数,值是-1说明没有符合条件的
调试欢乐多
但我用odbc_fetch_row能够等到内容啊
odbc_num_rows() will return the number of rows in an ODBC result. This function will return -1 on error. For INSERT, UPDATE and DELETE statements odbc_num_rows() returns the number of rows affected. For a SELECT clause this can be the number of rows available. Note: Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers. 注意它的note,所以这就不奇怪了
你可以用"select count(*)………………"
来实现啊
浅妄薄见,望与斟酌
按上面的说法它不是没用了吗
select count(*) as totalcount from table; 取的时候是$totalcount=rs['totalcount']; 就可以了
odbc_num_rows(int result_id)函数
我以前也是
后来没办法只能自己写了
我这里更奇怪,竟然返回-1.Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers. 可能驱动有问题.用
while(list($name)=odbc_fetch_row($rel)){
$n++;
}
echo $n;
$n++;
echo $n;