Answer the question
In order to leave comments, you need to log in
How to check if there is a record in the database or not?
Security Code
$today = date("Y-m-d"); // менял на дату $today = '2018-07-15' тоже не находит
$query = mysql_query("SELECT * FROM `EveryDayVisit` WHERE `data` = '$today'");
if(mysql_num_rows($query) > 0)
{
echo 'Зап. есть';
}
else
{
echo 'Не найден в базе данных';
}
echo 'Не найден в базе данных';
Answer the question
In order to leave comments, you need to log in
mysql_query has long been depricated in PHP, there is PDO to work with the database. Are you sure that, for example, the date is in the format in which you send it in the request? Or that the table is definitely not empty?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question