私はmysqlとphpを使用して、今日の日付に等しいすべてのユーザーをmysqlデータベースから引き出しています。私が抱えている問題は、次のコードを実行するたびにエラーが発生することです。エラーの外観からすると、年と関係があるように見えます。または、ドットが気に入らないかもしれませんが、よくわかりません。
<?php
$today = date("d.m.y");
$result = mysql_query("SELECT * FROM ymeg_chronoforms_data_NewsletterSubscribe
WHERE date=$today")or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo $row['name'] . " " . $row['email']. " " . $row['date'];
echo "<br />";
}
?>
これはそれが投げているエラーです:
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '.12' at line 2