How to provide a link from a resultset variable?
I have a list of id and name pairs in a database table using Mysqli.
The PHP code that prints them out is as follows:
while( $row = mysqli_fetch_array( $resultset, MYSQLI_NUM))
{ echo $row[0] ." - ". $row[1] ."\n <br/ >";
}
This works fine. There are up to 6000 items in this list, so it uses a repeat region (not shown).
I want to link to a page that will use the id to do things with it (like edit or delete a record).
I need to send the value of $row[0] to the next page, but use $row[1] as a link to a page called testlink.php.
The following code:
<a href="testlink.php?ref=<?php echo $row[0]; ?>"><?php echo $row[1];?> </a>
seems like a way to do it, but I cannot figure just how to insert this into the echo line without getting errors.
Can anyone help with the php code to do this?
And is there a better way to access individual items in very large lists other than using what is in effect a multi-page drop down menu.
Howard Walker
