Hi,
I have a small problem;
I do a search in my MySQL db collecting names and apartement numbers, resulting in vars $persons and $aptno.
I do a second search in MySQL in order to find out if two persons live in the same aptno. This is done with:
unset ($persons);
$result = mysql_query("SELECT * FROM tbl WHERE Aptno=$aptno ");
while ($row = mysql_fetch_array ($result)) {
if (!isset($persons)) {
$persons = $row[Name];
} else {
$persons = $persons . ", " . $row[Name];
}
}
The idea is to get names written out together on the same line for the same apt.
If I echo out within the function I get the whole list correctly. However, I would like to store the result in an array for later use outside of the function.
Don't know how to do that.
Any help appreciated. (Know this is basic stuff - quite embarrassed to ask...)