简体   繁体   English

获取今天的日期,在充满日期的表中找到它。 MySQL的/ PHP的

[英]Get today's date, find it in table full of date's. MySQL / PHP

I have a MySQL table full of date's in the format DATE. 我有一个充满日期的MySQL表,格式为DATE。 How would I find the current date, and then find it in the table and echo out its position in terms of row_id ? 我将如何找到当前日期,然后在表中找到它,并根据row_id回显其位置?

I understand I'm not providing any code with this question, but I'm struggling to find a place to start. 我知道我没有为这个问题提供任何代码,但我一直在努力寻找起点。

您可以使用CURDATE()函数来匹配当前日期:

select row_id from date_table where date_column = CURDATE();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM