conquest Posted September 14, 2008 Share Posted September 14, 2008 Hey there, This is my first time on the forum so gimme a break if sayin somethin stupid lol. ok so im trying to create a list of users using php, and with that i have no problem, but what i need is a link associated with each one that can store a unique variable for each record to be passed to the next page. e.g. list of 20 users displayed, when a user is selected, it takes you to their profile, so if user 8 was selected, user 8's id would be passed to the next page to call up related values in thier profile. heres the code i have so far: <?PHP // Make a MySQL Connection $query = "SELECT * FROM users ORDER BY 'userid' DESC"; $result = mysql_query($query) or die(mysql_error()); echo "<table width=400 border=0>"; echo "<th width=100> Battle </th>" . "<th width=100> User ID </th>" . "<th width=100> Level </th>" ."<th width=100> Username </th>" ."<th width=100> Alignment </th>"; while($row = mysql_fetch_array($result)){ echo "<tr><td>" . " <a href=battleplayer.php?id=" . $row['userid'] . "> Battle </a>" . "</td><td>". $row['userid']. "</td><td>". $row['level']. " </td><td> ". $row['username']. " </td><td> ". $row['alignment']; } echo "</td></tr></table>"; ?> </div> The problem so far lies in the following section where the hyperlink is created: echo "<tr><td>" . " <a href=battleplayer.php?id=" . $row['userid'] . "> Battle </a>" . "</td><td>". $row['userid'] Greatful for any help Link to comment https://forums.phpfreaks.com/topic/124229-solved-php-embeded-variables/ Share on other sites More sharing options...
Mchl Posted September 14, 2008 Share Posted September 14, 2008 And what kind of problem is that? Does it not display proper data, or does it show errors, or something else? Link to comment https://forums.phpfreaks.com/topic/124229-solved-php-embeded-variables/#findComment-641535 Share on other sites More sharing options...
conquest Posted September 14, 2008 Author Share Posted September 14, 2008 Dont know how to read or access the variables from another page Link to comment https://forums.phpfreaks.com/topic/124229-solved-php-embeded-variables/#findComment-641548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.