【发布时间】:2012-12-06 16:10:51
【问题描述】:
我想填充一个情绪下拉列表并将其保存到我的数据库中并带有时间戳。同时将情绪与当前用户联系起来。我应该如何处理这个?
在我的数据库中,我有一个名为“checkin”的表,其中包括:ID、时间、FKMoods(情绪列表的外键)和 FKUsers(用户的外键)。
现在我在“page.php”中有一个名为 checkin 的表单:
<form id="checkin" action="checkin/checkin.php" method="POST">
<label for="checkinMood">Select your current mood :</label>
<select id="checkinMood" class="SelectMood"></select><br />
<input type="submit" id="checkin-button" value="Update!" />
【问题讨论】:
-
你卡在哪里了?您面临的问题是什么?
-
您最好的选择是 1) 使用 PHP 操作创建一个 HTML 表单 - 就像您所做的那样,2) 您的 PHP 操作 (checkin/checkin.php) 将 3) 读取 POST 变量并4) 更新数据库。
-
@needhelp:你尝试了哪些方法?
-
我已经尝试过这个教程:aleixcortadellas.com/main/2009/02/13/277 但我也想要一个时间戳
标签: php javascript html mysql