|
<html> <head>
<title>Student Update page 2 Version 3</title>
</head> <body>
It is now <%= [ns_fmttime [ns_time] "%A, %B %e, %Y at %r" ] %><p><hr><p>
<%
set_the_usual_form_variables
# sets sid, QQsid, sname, QQsname, action
if {$action=="Update"} {
ns_adp_puts "<p>Updating $sid: $sname<p>"
db_dml s_row "update chuck.s set sname = '$QQsname' where sid = $sid"
set nrows [db_resultrows]
if {$nrows == 0} {
# no rows updated
ns_adp_puts "No matching entries found.<p>"
} else {
# one or more rows
ns_adp_puts "$nrows entries updated.<p>"
}
}
if {$action=="Delete"} {
ns_adp_puts "<p>Deleting: $sid: $sname<p>"
db_dml s_row "delete from chuck.s where sid = $sid"
set nrows [db_resultrows]
if {$nrows == 0} {
# no rows deleted
ns_adp_puts "No matching entries found.<p>"
} else {
# one or more rows
ns_adp_puts "$nrows entries deleted.<p>"
}
}
%>
<hr></body></html>
|