Say I wanted to run a query that returns all the usernames from a table users, but then I want to generate a link to the users profile from their name.
At the moment I imagine it will be something like:
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error() );
}
mysql_select_db("database", $con);
$result = mysql_query("SELECT username FROM users ORDER BY username DESC ");
while($row = mysql_fetch_array($result))
{
echo "<a href='";
echo $row['username'];
echo "'>";
echo $row['username'];
echo "<br/>";
}
?>
But the only problem with that is I don't want to have to create a page for every user. I would rather have a link they click, which then stores a variable like "session->clickedlink" and then use post to retrieve all their information on the next page.
Not sure if that makes any sense, but would love some advice.

New Topic/Question
Reply




MultiQuote





|