forked from science-ation/science-ation
Delete entries in the winners table when a project is deleted.
This commit is contained in:
parent
6bd6f971ac
commit
d38c57de79
@ -51,6 +51,11 @@ case 'load_row':
|
||||
|
||||
case 'delete':
|
||||
$regid = intval($_GET['id']);
|
||||
$q = mysql_query("SELECT * FROM projects WHERE registrations_id='$regid'");
|
||||
if(mysql_num_rows($q)) {
|
||||
$p = mysql_fetch_assoc($q);
|
||||
mysql_query("DELETE FROM winners WHERE projects_id='{$p['id']}'");
|
||||
}
|
||||
mysql_query("DELETE FROM registrations WHERE id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM students WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
mysql_query("DELETE FROM projects WHERE registrations_id='$regid' AND year='".$config['FAIRYEAR']."'");
|
||||
|
Loading…
Reference in New Issue
Block a user