我是wordpress的新手。我已经在functions.php中定义了一个函数
function mainInfo(){
$con = mysqli_connect("localhost","root","","wordpress");
$query = " INSERT INTO test ( name, email, message)
VALUES ( 'mahnoor', 'sfsf', 'message' ) ";
$result = mysqli_query($con, $query);
}
我想这样称呼它
<input class="form-control" id="selectDate" type="date" name="appointmentDate" type="mainInfo" value="" onchange="mainInfo();" required>
所以每次输入更改时都会调用此函数。但是它不起作用。请原谅我非常基本的问题,但对我们的帮助将不胜感激