Well you cannot send an array or object directly into mysql database, but there is a way to do the trick. Lets assume you have an array as below, the script will be able to perform magic for you:
PHP Code:
$idarray = array(1,2,3,4,5);
$idstring = implode(",", $idarray);
mysql_query("UPDATE table {$prefix}.adoptables SET idstring = '{$idstring}' WHERE id = '$id'");
This way your id array will be stored as a string in the table prefix.adoptables, column idstring, the implode function converts an array into a string.
To retrieve this data from your mysql table, use the explode function:
PHP Code:
$result = mysql_query("SELECT * from table {$prefix}.adoptables WHERE id = '$id'");
$row = mysql_fetch_array($result);
$idarray = explode(",", $row['idstring']);
Its also possible to generate a random number from the id array, I will explain to you later after I return from dinner.