我正在為我的博客開發(fā)后端,上傳圖像的代碼按預(yù)期工作,但在數(shù)據(jù)庫中沒有寫入任何內(nèi)容。當(dāng)我提交時(shí),它會(huì)上傳圖像并將其移動(dòng)到指定的文件夾,但在數(shù)據(jù)庫中沒有插入記錄。這是用于上傳的php。有沒有辦法解決這個(gè)問題?<form method="POST" action="functionabout.php" enctype="multipart/form-data"> <div class="col-md-9"> <!-- general form elements --> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">Add About Content</h3> </div> <!-- /.box-body --> <div class="box-body"> <div class="form-group"> <label for="heading">Heading</label> <input placeholder="Write Heading" class="form-control" name="heading" type="text" id="heading" required> </div> <div class="form-group"> <label for="subheading">Sub Heading</label> <textarea class="form-control" placeholder="Write Sub Heading" name="subheading" cols="50" rows="10" id="subheading" required></textarea> </div> <div class="form-group"> <label for="message">Message</label> <textarea placeholder="Write Details" class="form-control" name="message" cols="50" rows="10" id="message" required></textarea> </div> <div class="form-group"> <label for="Filename">Signature</label> <input name="Filename" type="file"> </div></div> <div class="box-footer fboxm"> <button type="submit" class="btn btn-primary"><i class="fa fa-check icheck"></i>Submit</button> <button type="reset" class="btn btn-warning"><i class="fa fa-undo icheck"></i>Reset</button> </div> </div> </div> </div> <!-- /.box --> </div> <!-- right column --> </form>我希望同時(shí)上傳文件并更新數(shù)據(jù)庫。
正在上傳文件但未在 mysql 中執(zhí)行查詢
寶慕林4294392
2021-07-02 09:02:27