Как получить значение базы данных в подсластителе?
База данных подключения
<code>
$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()){
И Sweet Alert2
<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']. Я плохо разбираюсь в английском.Я не знаю, что такое ошибка.