# Create session variables in dynamic tables

**URL:** <https://forum.kirupa.com/t/create-session-variables-in-dynamic-tables/235202>\
**Category:** programming\
**Created:** [August 9, 2007, 8:44am UTC](https://forum.kirupa.com/t/create-session-variables-in-dynamic-tables/235202 "2007-08-09T08:44:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeltonnberg](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@joeltonnberg](https://forum.kirupa.com/u/joeltonnberg)\
**Post date:** [August 9, 2007, 8:44am UTC](https://forum.kirupa.com/t/create-session-variables-in-dynamic-tables/235202/1 "2007-08-09T08:44:28Z")

</div>

I have a rather simple dynamic table which displays information from a certain column from a database. The code is as follows:

\<table border=“1”\>  
\<tr\>  
\<td\>Name\</td\>  
\</tr\>  
\<?php do { ?\>  
\<tr\>  
\<td\>\<?php echo $row\_Recordset1[‘Name’]; ?\>\</td\>  
\</tr\>  
\<?php } while ($row\_Recordset1 = mysql\_fetch\_assoc($Recordset1)); ?\>  
\</table\>

However, how do I do so I can click on each row of data that is displayed (so it redirect to another page) and create a session variable with the same value as the data in a particular row displayed? For example, if the Recordset retrieve and display the value "james, when clicked I want to create a session variable named “james” and redirect to another page.
