function search_infoTable($chemicals)
{
    if (!database_connect()) {
        return "DB_CONNECT_FAILURE";
    }
    if (empty($chemicals)) {
        return "NO_SEARCH";
    }
    # Set up parameters of a basic chemicalSGA search
    $search = "chemicalConditions.*, chemicals.structure_pic";
    $table = "chemicalConditions, chemicals";
    #Build the where statement
    $andQueryArray = array();
    if (!empty($chemicals)) {
        array_push($andQueryArray, "chemicalConditions.chemical_name IN " . build_IN_LIST($chemicals));
    }
    //array_push($andQueryArray, build_OR($chemicals, "chemicalConditions.chemical_name='", "'"));}
    array_push($andQueryArray, 'chemicalConditions.chemical_name = chemicals.name');
    $where = build_AND($andQueryArray);
    //echo($where);
    //print $where;
    #Do the search
    $result = database_select_distinct_search($search, $table, $where);
    # Throw the results into an array
    $resultArray = array();
    while ($row = mysql_fetch_assoc($result)) {
        array_push($resultArray, $row);
    }
    #database dc
    database_disconnect();
    #return the results array
    if (count($resultArray) == 0) {
        return "EMPTY";
    }
    # Is the array empty?
    return $resultArray;
}
function search_info_chemicals($chemicals)
{
    // This search has the purpose of grabbing chemical info
    if (!database_connect()) {
        return "DB_CONNECT_FAILURE";
    }
    if (empty($chemicals)) {
        return array();
    }
    # Set up parameters
    $search = "*";
    $table = $GLOBALS['TABLE_CHEMICAL_NAMES'];
    #Build the where statement
    $andQueryArray = array();
    if (!empty($chemicals)) {
        array_push($andQueryArray, $GLOBALS['TABLE_CHEMICAL_NAMES'] . ".pid IN " . build_IN_LIST($chemicals));
    }
    $where = build_AND($andQueryArray);
    #Do the search
    $result = database_select_distinct_search($search, $table, $where);
    # Throw the results into an array
    $resultArray = array();
    while ($row = mysql_fetch_assoc($result)) {
        #$row["pid"] = $row["chemid"];
        $row["searchType"] = "CHEMICAL";
        array_push($resultArray, $row);
    }
    #database dc
    database_disconnect();
    #return the results array
    if (count($resultArray) == 0) {
        return "EMPTY";
    }
    # Is the array empty?
    return $resultArray;
}