The field: Friends, and contains something like "2,3,6,3,67,97" the numbers are user ID's.
i want to know if there is a way to get those numbers into an array?
Thanks in advance
The field: Friends, and contains something like "2,3,6,3,67,97" the numbers are user ID's.
i want to know if there is a way to get those numbers into an array?
Thanks in advance
You could do something like
$counter = 0;
$array = array();
while($row = mysql_fetch_array($sql)) {
$array[$counter] = explode(",", $row['friends']) // or whatever the column is called
$counter++;
}
So for the first entry in the database,
$array[0][0] = 2
$array[0][1] = 3 // etc etc...
Apologies if the code is wrong, been a while since I've worked with multi-dimensional arrays. Hope the concepts helped though :)