Skip to content

Commit ac83e1f

Browse files
authored
Merge pull request #22 from compuvin/master
Update develop
2 parents ecd1b2b + f2e4b19 commit ac83e1f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

edit-appinfo.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,7 @@ function showlicensedapps(freeyn)
108108
$LicenseComments = $_POST["LicenseComments"];
109109
//$result = mysqli_query($connection,"select Publisher from software_matrix.applicationsdump where applicationsdump.Name = '$Name' LIMIT 1");
110110
$Publisher = mysqli_fetch_assoc(mysqli_query($connection,"select Publisher from applicationsdump where Name = '$Name' LIMIT 1"))['Publisher'];
111-
if (mysqli_query($connection,"SELECT ID, Name FROM licensedapps where Name = '$Name' limit 1") !== FALSE) { //Check to see if the license information already exists
112-
$result = mysqli_query($connection,"UPDATE licensedapps SET Name = '$Name', Publisher = '$Publisher', Amount = '$LicenseAmt', Comments = '$LicenseComments' where Name = '$Name'"); //New entry
113-
} else {
114-
$result = mysqli_query($connection,"INSERT INTO licensedapps SET Name = '$Name', Publisher = '$Publisher', Amount = '$LicenseAmt', Comments = '$LicenseComments'"); //New entry
115-
}
111+
$result = mysqli_query($connection,"INSERT INTO licensedapps SET Name = '$Name', Publisher = '$Publisher', Amount = '$LicenseAmt', Comments = '$LicenseComments' ON DUPLICATE KEY UPDATE Amount = '$LicenseAmt', Comments = '$LicenseComments'"); //Add or Update entry
116112
}
117113
echo $Name . " was updated successfully. Here's were we'll want to go back to the previous page.";
118114
echo '<script type="text/javascript">window.location = "' . $_POST["WebAddr"] .'"</script>';

0 commit comments

Comments
 (0)