php - sqlssrv_num_rows not returning anything
问题描述
- PHP 7.2.21
- Database is on MS SQL, and the database connection is working
I have found and read sqlsrv_num_rows Not Returning Any Value. I have updated the $options
based on the solution, but my code still does not return any results.
If I run the query in SQL, I get 8 records, so I know the data is there.
$sql = "SELECT * FROM Question WHERE Category = 'HD';";
$params = array();
$options = array( "Scrollable" => 'keyset' );
$stmt = sqlsrv_query( $conn, $sql, $params, $options );
if( $stmt === false ) { reportSQLError($sql, $params); }
$maxHDQ = sqlsrv_num_rows($stmt);
解决方案
The code itself is ok and should work. What are the values for $stmt
and $maxHDQ
?
推荐阅读
- php - 如何以表格格式设置我的 php 电子邮件回复样式?
- python - ModuleNotFoundError:没有名为“瓶子”的模块
- angular - Angular ReactiveForm 显示值 OnPush
- android - Android:构建时指向 DI:dagger 的“构建失败”错误
- java - Html 输入数字仅接受自然数或带有 ,25 或 ,5
- angular - 我应该如何使用 transloco i18n(internationalization) 库更改 Material Table 标题以进行分页和页面范围、下一个、上一个按钮?
- r - 从 VBA 运行 R 脚本
- angular-material - 使用 ng generate 生成材质组件时,找不到 NgModule 错误
- python - 如何合并 matplotlib.table 中的单元格
- oracle - 我们可以从 oracle 中的匿名块调用过程或函数吗?