[英]How to select MYSQL Content with between Date
How can I display values from the database of the Stand column with the help of the Datum column between two dates?如何借助 Datum 列在两个日期之间显示 Stand 列的数据库中的值?
I tried the following code, but no result:我尝试了以下代码,但没有结果:
$sqlAverage10 = "SELECT Stand FROM Aktienstand WHERE Symbol=:symbol AND Datum BETWEEN :startDate AND :endDate10";
if ($stmtAverage10 = $pdo->prepare($sqlAverage10)) {
$stmtAverage10->execute(array(
':symbol' => $kurs['Symbol'],
':startDate' => $startDate,
':endDate10' => $endDate10
));
//var_dump($kurs['Datum']);
//var_dump ($stmtAverage10);
//echo ($startDate = $kurs['Datum']);
$stmtAverage10New = $stmtAverage10->fetch(PDO::FETCH_ASSOC);
:symbol = test :startDate = 2021-10-09 :endDate = 2021-09-29
:symbol = 测试 :startDate = 2021-10-09 :endDate = 2021-09-29
My table for eg:我的表例如:
https://i.stack.imgur.com/abEta.png https://i.stack.imgur.com/abEta.png
只要您的列是date
或datetime
列,这应该有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.