The point of storing them in the user_meta is to be able to print the same post->id
in another page while querying the same field. This is what I have so far.
So I have tried what you said earlier but I cant make it work:
/////////////////Colecionables
function coleccionables_producto() {
echo "</a>";
//foreach ($product_id as $id_prdct) {
include('connection-db.php');
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
//echo "SELECT * FROM `mg_usermeta` WHERE user_id = '" . "$user_id" . "';";
//echo "SELECT * FROM `mg_usermeta` WHERE user_id = '" . "$user_id" . "';";
global $current_user, $product, $post;
$user_id = $current_user->ID;
$product_id = $post->ID;
if (isset($_POST['quiero'])) {
$quieroPost = serialize(array_values($_POST['quiero']));
update_user_meta( $user_id, 'lo_quiero', $quieroPost, false );
} else if (isset($_POST['tengo'])) {
$tengoPost = serialize(array_values($_POST['tengo']));
update_user_meta( $user_id, 'lo_tengo', $tengoPost, false );
} else {
//no button pressed
}
?>
<form id="wishlist-double" name="escoje" action="" method="POST" enctype="multipart/form-data">
<input id="quiero" type="radio" name="quiero" value="<?php if(isset($user_data['quiero'][0])): echo $user_data['quiero'][0]; endif; ?>-<?php echo esc_attr($post->ID); ?>A" href="#">Lo Quiero</button>
<input id="tengo" type="radio" name="tengo" value="<?php if(isset($user_data['tengo'][0])): echo $user_data['tengo'][0]; endif; ?>-<?php echo esc_attr($post->ID); ?>B" href="#">Lo Tengo</button>
<div id="formMessages"></div>
</form>
<?
//}
}