-1
我有一個名爲dtr
的表,它有5列:id
student_id
time_in
time_out
和date
。如何插入空值列/更新數據?
我做我的項目是什麼,讓用戶輸入自己的ID號,然後將程序掃描,如果ID號碼在數據庫中。如果是在數據庫中的ID號碼的第一輸入將以time_in
列插入數據。並且在相同的ID號碼的第二輸入將在time_out
柱插入數據。
這是我希望發生的:
if(inputtedIDNumber == fromDatabase)
{
//ID Number found
if(the column 'time_out' is null)
{
//update the row that 'time_in' has a value and add time in 'time_out' column
}
else
{
//add new row and will insert ID Number, time_in, and date
}
}
else
{
//ID number not found
}
我在代碼中看不到空值。 – Richard
@Richard我編輯它,希望你能理解我。 –
那麼什麼是問題/問題? – SeM