我试图将1列中的所有结果都放入数组中。我在下面尝试了以下内容,但我从输出中得到的只是“数组”。
$sql = "SELECT pickID FROM picks WHERE userID = 2 ";
$query = mysql_query($sql);
$result = mysql_fetch_array($query);
$i = 0;
$pickArray = array();
foreach($result as $row) {
$pickArray[$i] = $row['pickID'];
$i++;
}
echo $pickArray;