我试图将mysql数据库行回显到bootstrap中的输入字段。这是我尝试过的,但它没有用。
<div class="form-group">
<label for="applicantName" class="form-control-label">Name:</label>
<input type="text" class="form-control" name="applicantName" id="applicantName" value="<?php echo $row['jobSubject']; ?>">
</div>
我实现了这个目标,因为它不必是一个输入值,只是通过这样做的纯文本。
$query = "SELECT
JobId,
JobSubject
FROM
Jobs
WHERE
Jobs.JobId = " . mysql_real_escape_string($_GET['id']);
$result = mysql_query($query);
$i=1;
while($row = mysql_fetch_assoc($result))
{
?>
<form action="ApplyForJob.php" method="post">
<div class="modal fade" id="jobApplicationModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Job Title you are applying for: <?php echo $row['JobSubject']; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
有什么建议吗?
答案 0 :(得分:1)
你有一个错字:
env('app.name') -> config('app.name')
应该是
value="<?php echo $row['jobSubject']; ?>"
点击此处:
value="<?php echo $row['JobSubject']; ?>"