php - 如何在 Sweetalert 中获取价值 Mysqli
问题描述
如何在 sweetalert 中获取价值数据库?
数据库连接
$db = new PDO("mysql:host=localhost;dbname=mydata","root","");
$stmts = $db->prepare("select * from access Where User_Id=$UserID OR File_Id =0");
$stmts->execute();
while($rows = $stmts->fetch()){
$stmt = $db->prepare("select * from newfiles Where Id = ".$rows['File_Id']." OR User= $UserID ");
$stmt->execute();}
while($row = $stmt->fetch()){
和甜蜜的警报2
<script>
function Share() {
swal.fire({
title: "Who will you share?",
html: '<form name="Share" method="get" action="Share.php" enctype="multipart/form-data">'+
'<input type="text" name="username" id="username" class="form-control mb-3" style="color: #574ae2;" placeholder="Username" required>'+
'<input type="hidden" name="file" id="file" class="form-control mb-3" style="color: #574ae2;" value="<?php $row['filename'] ?>" required>'+
'<button class="btn btn-cloud btn-block my-3" type="submit" name="Submit" value="Submit" ><i class="fas fa-sign-in-alt"></i> Submit</button>'+
'</form>',
type: "info",
showCancelButton: true,
showConfirmButton: false,
confirmButtonColor: "Red",
closeOnConfirm: false,
closeOnCancel: false,
}).then((result) => {
if (result.value) {
} else {
swal.fire('Cancelled','You Cancelle', 'error');
}
});
}
</script>
我无法获得价值 $row['filename']。 我不擅长英语。我不知道什么是错误。
解决方案
推荐阅读
- sql - 如何在 Oracle 中查询多级项目符号点 xxx?
- java - 如何在 java 的 FileReader 方法中输入正确的文件名
- mysql - mysql中带有if条件的group_concat
- python - 将 Pyqtgraph 嵌入到 PySide2
- android - 如何在 android 的共享首选项中保存 Seekbar 进度?
- java - jboss 抛出 Unmarshalling 错误:null 调用签名验证 Web 服务
- c - 数组不存储结构的地址
- angular - 如何使用 Angular 5 修复方法 DELETE
- python - 了解 scipy.stats.multivariate_normal 的输出
- angularjs - 当 ng-show / ng-if 在 md-option 的 ng-repeat 内时,它不会更新变量