I have been trying to figure this out all day, but no luck.
I just can't seem to get the hang of arrays. Here is my story.
I have a page created by a query, it returns all the members of a database
listed row by row with some basic info, id, name, etc. on the member.
On the column of the user id I have a link on each id that will pass the user's id to a new php page where all the data is pulled and put into a form so the members information can be edited and updated.
I have the id passing to the new page, but it just shows the (wrong user) last member in the database. So I know I am running through the array and not using just the one returned in the field.
Here is the code from the first where I set the link and id in a session variable
echo
<<<SNIP>>>
while($row = mysql_fetch_array($sql, MYSQL_NUM)){
// Build your formatted results here.
echo "<td><a href='editmembers.php'>$row[0]</a></td>";
$memid = $row[0];
echo "<td>$row[1]</td>";
echo "<td>$row[2]</td>";
echo "<td>$row[3]</td>";
echo "<td>$row[4]</td>";
echo "<td>$row[5]\n</td></tr>";
}
echo "</table>";
$memid= $_SESSION['memid']; //set the id into a session
<<SNIP>>
On the next page editmembers.php, I am just running a query on $memid. It works as far as carrying the $memid forward and populating the fields, I am just getting the last user in the database. So it runs through the whole list and shows the last user.
How do I set this up so that I am selecting just the one id from $row[0] that is showing on the page?