我有三个表:
user (id,name,password,......)
words (id,word,meaning)
userword (id, user_id,word_id,checking,old)
我在 php 中有一个查询:
$user= $_SESSION['userid'];
$result = mysql_query("SELECT *
FROM words
WHERE id
IN (
SELECT word_id
FROM userword
WHERE old =0
AND user_id =$user
LIMIT 10
)
");
此查询正常工作,但在此之后我想更新我选择的单词并为它们设置 old=1 我该怎么办?