survey_seahorse

Software Engineering Project - Fall 2018
Log | Files | Refs | README

commit 04239e406be418888527bb8ce7938b7c4120c49e
parent b5c445f33dcfc3a44d87bf042593a20cf11eff1f
Author: John Kubach <johnkubach@gmail.com>
Date:   Mon, 17 Dec 2018 22:42:46 -0500

change survey deletion

change order in which survey data is removed from the database.

Diffstat:
Mwebsite/res/delete-survey.php | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/website/res/delete-survey.php b/website/res/delete-survey.php @@ -18,13 +18,13 @@ if (isset($_POST['delete-survey'])) { $result = mysqli_query($connect, $sql); $row = mysqli_fetch_assoc($result); $sid = $row['survey_id']; - $deleteSurvey ="DELETE FROM survey WHERE survey_id=$sid;"; - $deleteQuestions ="DELETE FROM question WHERE survey_id=$sid;"; $deleteAnswers ="DELETE FROM answer_numeric WHERE survey_id=$sid;"; + $deleteQuestions ="DELETE FROM question WHERE survey_id=$sid;"; + $deleteSurvey ="DELETE FROM survey WHERE survey_id=$sid;"; - mysqli_query($connect, $deleteSurvey) or die(mysqli_error($connect)); - mysqli_query($connect, $deleteQuestions) or die(mysqli_error($connect)); mysqli_query($connect, $deleteAnswers) or die(mysqli_error($connect)); + mysqli_query($connect, $deleteQuestions) or die(mysqli_error($connect)); + mysqli_query($connect, $deleteSurvey) or die(mysqli_error($connect)); exit(); } }