You were faster than I thought, therefore my last comment again:
The way you check it, it checks first wether finished is not no, could also be nothing. Means, if for any reason your script is passing an empty finished first action will happen.
Better check it like this:
if($finished == "yes"){
do this
}elseif($finished == "no"){
do that
}else{
throw an error because $finished should be either yes or no, nothing else
}
Addition:
I see that your queries are always executed. $fin, $fini, etc are only the variables that take the result. you must rewrite this piece of code:
<?
$conedit = mysql_pconnect("localhost","ethanwe_ethan","password") or die("Unable to connect to SQL server");
mysql_select_db("ethanwe_timpc", $conedit) or die("Unable to select database");
$editdata = "UPDATE guests SET customername='$_POST[name]', customerphone='$_POST[phone]', datecheckin='$_POST[date]', computerlocation='$_POST[location]' WHERE ticketnumber = '$_POST[ticket]'"
$fini = "DELETE FROM guests WHERE ticketnumber = '$_POST[ticket]'";
$fin = "INSERT INTO guests_old(ticketnumber, customername, customerphone, datecheckin, computerlocation) VALUES('$_POST[ticket]','$_POST[name]', '$_POST[phone]', '$_POST[checkin]', '$_POST[location]')";
$finished=$_POST[finished];
if($finished == "yes"){
mysql_query($fin);
mysql_query($fini);
}
elseif($finished == "no"){
mysql_query($editdata);
}else{
//code to throw error
}
?>
You have to remove the mysql_query int the definitions because $fin, $fini and $editdata should only be variables containing the statement and not the executed statements themselves.
regards
gaucho