php - 在加载 SQL 时更改游标
问题描述
我有一个网站,您可以在其中使用 a 在数据库中搜索form
,因为数据库非常大,需要一些时间(例如 5 秒),我想将光标更改wait
为告诉人们,代码正在搜索和他们不必再次单击提交按钮。问题是我不知道如何仅在站点从数据库中收集所有行时更改光标。
我有一个index.php
仅打印的页面,form
并且每次更改案例时,它都会调用另一个页面search.php
,因此,例如,如果我更改了我的 select 的值form
,它将提交form
并调用我的另一个 php,该 php 创建一个 SQL 请求和将其查询到我的 SQL Server 数据库。我想更改光标,直到所有行都打印在页面上。
我试过这个search.php
:
# Gather informations with $_POST[]
# Connect to the database
<div class='pointer'>
if ($co) {
$stmt = sqlsrv_query($co, $sql, $params, options);
while ($lines=sqsrv_fetch_array($stmt)) {
# some html code which put every lines in a string
}
# print the string with all lines and closethe database
}
</div>
在我的CSS中我有:
.pointer{
cursor: wait;
}
# Other lines
这不起作用,我需要你的帮助
解决方案
推荐阅读
- python - PyTorch weak_script_method 装饰器
- java - 未找到 Intellij JavaFX helloWorld 模块
- javascript - 在新窗口中打开一个 src 脚本
- mysql - mysql请求如果不存在
- c++ - 使用 std::filesystem::path 在分隔符类型之间进行转换
- node.js - 从 AWS Lambda 提供 zip 文件
- node.js - 如何通过 REST 将测试用例添加到 TFS
- mongodb - 以下两个 mongodb 查询有什么区别?
- apache-kafka - KSQL 查询给我的请求增加了太多延迟
- elasticsearch - 为字段设置规范化器