我正在创建一个Web应用程序,如果用户单击名为"WEEK"的链接,该页面将显示该周提交的所有帖子.还可以选择查看本月提交的所有帖子.posts表中有一个名为post_date的列,其中日期的格式为:YYYY-MM-DD.
我的问题:我不知道如何生成本周和月份提交的帖子.
我可以成功选择当前日期提交的帖子,如下所示:
$today = date("Y-m-d"); // This is the format of the DATE column named post_date in the posts table.
if($_GET['when'] == "today")
{
$when = $today;
}
else if ($_GET['when'] == "week")
{
$when = // I don't know what goes here if I want to generate posts submitted this week
}
else if ($_GET['when'] == "month")
{
$when = // I don't know what goes here if I want to generate posts submitted this month
}
// …Run Code Online (Sandbox Code Playgroud) 我正在开发Flask应用程序,并希望将其部署在Koding上,以便我的其他团队成员也可以查看/编辑它.我在一个VM(在Koding.com上)克隆了git存储库,安装了PIP,安装了依赖项,但是当我启动flask服务器时,它显示服务器已经启动并且在127.0.0.1:5000上运行.
但是当我去:5000时,它表示VM不活跃.
注意:通常在VM的"Web"文件夹下工作并显示文件.