我正在使用 php ajax 创建简单的 crud 系统。在 crud 系统中,我还添加了图像。但是当我填写数据并浏览图像并单击添加按钮时,记录未添加到数据库中。到目前为止我尝试了什么我附加了下面。控制台上没有显示错误。我认为可能是 jquery 发送表单值和图像数据的问题:{form_data: form_data,data: data},
表格设计
<form role="form" id="frmcompany" class="card" enctype="multipart/form-data">
<div align="left">
<h3>Company</h3>
</div>
<div align="left">
<label class="form-label">Company name</label>
<input type="text" class="form-control" placeholder="Patient No" id="cno" name="cno" size="30px" required>
</div>
<div align="left">
<label class="form-label">Country</label>
<input type="text" class="form-control" placeholder="Patient Name" id="coutry" name="coutry" size="30px" required>
</div>
<div align="left">
<label class="form-label">Currency</label>
<input type="text" class="form-control" placeholder="Phone" id="currency" name="currency" size="30px" required>
</div>
<div align="left">
<label class="form-label">Address</label>
<input type="text" class="form-control" placeholder="Address" id="address" name="address" size="30px" required>
</div>
<div align="left">
<div class="fileuploader fileuploader-theme-default">
<input type="hidden" name="fileuploader-list-files_" value="[]">
<input type="file" id="file" name="file" >
<div class="fileuploader-items">
<ul class="fileuploader-items-list"></ul>
</div>
</div>
</div>
</br>
<div align="right">
<button type="button" id="save" class="btn btn-info" onclick="addPatient()">Add</button>
<button type="button" id="clear" class="btn btn-warning" onclick="reset()">Reset</button>
</div>
</form>
慕哥6287543
凤凰求蛊