How can i change this into mysqli?
// add meta_key to the query
$get_user_data = mysql_query("SELECT `meta_value`,`meta_key` FROM `table` WHERE `user_id` = $user_id", $link);
// use _assoc instead of _array, we do not need the numerical indexes.
while($row=mysql_fetch_assoc($get_user_data)){
$userdata[$row['meta_key']] = $row['meta_value'];
}