<commit_before><?php
/**
 * Created by IntelliJ IDEA.
 * User: <NAME>
 * Date: 3/1/2016
 * Time: 9:48 AM
 */

require_once 'dbconnect.php';
require_once 'queries/SelectQueries.php';

/*
   * Collect all Details from Angular HTTP Request.
*/

if(!$result = $db_server->query($allMessages)){
    //the query failed
    die('There was an error running the query [ ' . $db_server->error . ' ].');
}

//returning the results of the query in json format
echo json_encode($result); //this will go back under "data" of angular call.
$result->free();
?><commit_msg>returning messages in json format<commit_after><?php
/**
 * Created by IntelliJ IDEA.
 * User: <NAME>
 * Date: 3/1/2016
 * Time: 9:48 AM
 */

require_once "../dbconnect.php";
require_once '../queries/SelectQueries.php';

/*
   * Collect all Details from Angular HTTP Request.
*/

if(!$result = $db_server->query($allMessages)){
    //the query failed
    die('There was an error running the query [ ' . $db_server->error . ' ].');
}

$json_result = array();
//$return_arr = array();

//using assoc here because it would be easier for future modifications
while($row = $result->fetch_assoc()){
    /*
    $row_array['entry#'] = $row['entry#'];
    $row_array['name'] = $row['name'];
    $row_array['email'] = $row['email'];
    $row_array['subject'] = $row['subject'];
    $row_array['comment'] = $row['comment'];
    $row_array['redirect'] = $row['redirect'];
    $row_array['browserinfo'] = $row['browserinfo'];
    $row_array['topic'] = $row['topic'];
    $row_array['date'] = $row['date'];

    array_push($return_arr,$row_array);
     */

    $json_result[] = $row;
}

//returning the results of the query in json format
echo json_encode($json_result); //this will go back under "data" of angular call.
$result->free();
?>
{'fraction_non_alphanumeric': 0.18574635241301907, 'fraction_numerical': 0.010101010101010102, 'mean_word_length': 3.884931506849315, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '6590600', 'n_tokens_mistral': 605, 'n_tokens_neox': 588, 'n_words': 156}