javascript - 如何根据输入值使用javascript在mysql中插入数据
问题描述
function message() {
$connection=mysqli_connect("localhost","root","","halcondentalclinic");
var s = document.getElementById('edit_otherValue');
if (s=="Crown") {
<?php
$try18s=="Crown";
$db="INSERT INTO tooth1(treatment)VALUES('$try18s')";
$db_run=mysqli_query($connection,$db);
?>
}
}
<input type=text name=edit_otherValue id=edit_otherValue value="" />
<button onclick="message()" type="submit" name="treatmenthistoryupdatebtn" class="btn btn-primary">Save</button>
如何根据输入值使用 javascript 在 MySQL 中插入数据 我只是 javascript 的初学者。
解决方案
推荐阅读
- docker - 批处理脚本将所有行作为一个调用执行
- java - 如何使用 Spring Boot 和 Angular 7 配置 CRSF
- java - 有没有办法在构建片段后调用方法?
- typescript - 在打字稿中使用绝对路径进行导入
- postgresql - Postgresql 日期类型在公元 0 年有一个世纪的空白
- ios - 如何在目标 c init 中将对象作为依赖项传递?
- symfony4 - 更新时删除空属性
- java - 如何在使用 Criteria 的查询中构建休眠多重限制
- python - 如何获得关于输入的梯度并更改输入(而不是可训练的变量)以最小化 TF 2 中的损失?
- angular - primeng 多选中的默认选中选项