$data_array = array(
array(
'ID',
'Name',
'Designation ',
'Message'
)
);
$sql = mysql_query("SELECT * FROM tbl_name");
while($data = mysql_fetch_object($sql))
{
array_push($data_array, array(
$data->id,
$data->name,
$data->designation,
$data->message
));
}
如何为任何sql表字段创建动态数组,或者像数据数组中的数据一样动态获取字段值?