repcont.html
if(request.search1 || request.search2) {
dbconnect();
if(request.search1) {
//if they search using the textbox 中文姓名=first name
contact = database.cursor("SELECT * FROM contacts WHERE firstname LIKE '%" + request.search1 + "%' ORDER BY firstname")
}
if(request.search2) {
if(request.search2 == "all") {
//Select all the contacts, no search criteria
contact = database.cursor("SELECT * FROM contacts ORDER BY lastname")
}
else {
//Select all contacts where the last name starts with the letter chosen.
var lowcaps = request.search2.toLowerCase()
contact = database.cursor("SELECT * FROM contacts WHERE lastname LIKE '" + request.search2 + "%' OR lastname LIKE '" + lowcaps + "%' ORDER BY firstname")
}
}
}
write("2.顯示全部資料")