我正在尝试显示与今天的日期匹配的数据。我的页面上没有数据显示。我在Axios上使用PHP PDO。有人可以帮忙解决我的问题吗?
public function retreiveDateToday() {
$transaction_date = date("Y-m-d");
$sql = "SELECT * FROM tbl_transaction WHERE datetime LIKE '%2019-05-19%'";
$stmt = $this->connection->prepare($sql);
$stmt->execute([
":transaction_id" => $transaction_id,
":beneficiary_id" => $beneficiary_id,
":user_id" => $user_id,
":transaction_date" => $transaction_date
]);
return $stmt->fetchAll();
}
VueJS方法
retrieveReturnMedicine : function() {
axios({
method : "GET",
url : this.urlRoot + "gulod/retrieve_date_today.php"
}).then(function (response){
vm.dateToday = response.data;
console.log(response);
});
}
....
<?php
include '../../private/initialize.php';
$transaction = new Transaction();
echo json_encode($transaction->retreiveDateToday());