<commit_before><?php
require("../../../includes/config.php");
$groupName 	= $_REQUEST['groupName'];
$mids		= $_REQUEST['mids'];
$action		= $_REQUEST['action'];

if ($action == "insert") {
 $existing = mysql_query("select Id from Groups where Name = '" . $groupName . "'");
 if (!$row = mysql_fetch_array($existing)) {
  $query = "insert into Groups (Name, MonitorIds) VALUES ('" . $groupName . "', '" . $mids ."')";
 }
} elseif ($action == "update") {
 $query = "update Groups set Name = '" . $groupName . "'";
} elseif ($action == "delete") {
 $query = "delete from Groups where Name = '" . $groupName . "'";
} else {
 die('Invalid Action!');
}

mysql_query($query) or die('Error, query failed!');
?><commit_msg>Added comments and fixed code to correctly print out an array<commit_after><?php
require("../../../includes/config.php");
$groupName 	= $_REQUEST['groupName'];
$mids		= $_REQUEST['mids'];
$action		= $_REQUEST['action'];

if ($action == "insert") { # Insert a new group
 $existing = mysql_query("select Id from Groups where Name = '" . $groupName . "'");
 if (!$row = mysql_fetch_array($existing)) { # Only if the group does not already exist
  $query = "insert into Groups (Name, MonitorIds) VALUES ('" . $groupName . "', '" . $mids ."')";
 }
} elseif ($action == "update") { # Update a group (Currently name only)
 $query = "update Groups set Name = '" . $groupName . "'";
} elseif ($action == "delete") { # Delete a group
 $query = "delete from Groups where Name = '" . $groupName . "'";
} elseif ($action == "select") { # Select all the tabs to be loaded into the Daskboard
 $query = "select Name from Groups";
} else {
 die('Invalid Action!');
}

$result = mysql_query($query) or die('Error, query failed!');
while($row = mysql_fetch_array($result)){
 echo $row['Name'] . ',';
}
?>
{'fraction_non_alphanumeric': 0.21023359288097887, 'fraction_numerical': 0.0, 'mean_word_length': 4.260233918128655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1748323', 'n_tokens_mistral': 568, 'n_tokens_neox': 564, 'n_words': 170}