コード例 #1
0
function changeQueryIntoJSON($nameJSON, $structure, $connection, $sql, $params, $operation, $pdo)
{
    $result = generalQuery($connection, $sql, $params, $operation, $pdo);
    $restructured = $operation === 0 && rightResult($result) ? restructureArray($result, $structure) : $result;
    return changeArrayIntoJSON($nameJSON, $restructured);
}
コード例 #2
0
ファイル: queryintojson.php プロジェクト: hevelmo/compress
function changeLineIntoArray($line, $spl, $structure)
{
    $splArray = array();
    $trimLine = trim($line);
    if ($trimLine !== '') {
        $row = explode($spl, $trimLine);
        $count = 1;
        for ($idx = 0; $idx < count($row); $idx++) {
            $element = trim($row[$idx]);
            if ($element !== '') {
                $splArray[] = array($count++, $element);
            }
        }
    }
    if (count($splArray) && count($structure)) {
        $splArray = restructureArray($splArray, $structure);
    }
    return $splArray;
}
コード例 #3
0
function restructureQuery($structure, $connection, $sql, $params, $operation, $pdo)
{
    $result = generalQuery($connection, $sql, $params, $operation, $pdo);
    $restructured = $operation === 0 && rightResult($result) ? restructureArray($result, $structure) : $result;
    return $restructured;
}