-saturn-
Thu 10th May '01, 4:04pm
How can I get the current index of an array when going through it with a while loop like this?
$birth=$DB_site->query("SELECT username,userid FROM user WHERE birthday='$d' ORDER by username");
while ($birthday = mysql_fetch_array($birth)) {
$membername = $birthday[username];
$memberid = $birthday[userid];
$birthdays .= $membername." ".$last;
}
What I want to do is the $last variable to get the "," value for every element of the array except for the last one which should be "".
$birth=$DB_site->query("SELECT username,userid FROM user WHERE birthday='$d' ORDER by username");
while ($birthday = mysql_fetch_array($birth)) {
$membername = $birthday[username];
$memberid = $birthday[userid];
$birthdays .= $membername." ".$last;
}
What I want to do is the $last variable to get the "," value for every element of the array except for the last one which should be "".