I need to merge many arrays from a mysql DB I have. The amount of arrays can vary. I am serializing the data into the DB and unserializing it on the way out. Where I am stumped is trying to use array_merge but not sure how to get the data into it properly.
For instance I have
$sql_get_votes_data = "SELECT * FROM algo_users WHERE data LIKE '%$movie_id%'";
$result_get_votes_data = mysql_query($sql_get_votes_data);
$final_array = array();
while($row_get_votes_data = mysql_fetch_array($result_get_votes_data)) {
$final_array[] = unserialize($row_get_votes_data['data']);
}
Ultimately I need to be able to do a unique merge like this.
array_unique(array_merge($final_array1,$final_array2), SORT_REGULAR);
But since I have to place each array into a seperate variable in order to pass into array_merge I am not sure how to do that from the mysql call.
Any help would be awesome.