-3

有什么方法可以在不打印列标题的情况下在 SQLite 中选择表?

以下是我正在使用的代码:

SELECT realPow, timestamp 
FROM PowerData;

//To loop through the table and fetch the data for Real power
while($res = $results->fetchArray(SQLITE3_ASSOC)){
    $equal[] = $res;
}
echo json_encode($meArray,JSON_NUMERIC_CHECK);

结果:

[{"realPow":50,"timestamp":1391990400},{"realPow":200,"timestamp":1392422400},
{"realPow":100,"timestamp":1394409600},{"realPow":150,"timestamp":1395273600},
{"realPow":140,"timestamp":1397952000},{"realPow":130,"timestamp":1398384000},
{"realPow":120,"timestamp":1400544000},{"realPow":90,"timestamp":1402358400},
{"realPow":100,"timestamp":1402790400}]

我想删除“realPow:”和“时间戳:”。

4

1 回答 1

-1

这是您修改的代码:

SELECT realPow, timestamp FROM PowerData;

    //To loop through the table and fetch the data for Real power
    while($res = $results->fetchArray(SQLITE3_ASSOC)){
        $equal[] = array($res['realPow'], $res['timestamp']);
    }
    echo json_encode($meArray,JSON_NUMERIC_CHECK);
于 2014-06-26T05:30:26.567 回答