I have two current problems I am trying to solve.
First I am trying to make a hyperlink inside a table that will use a base URL and subsitute different usernames into the url and name the URL something like homepage. For example I want to have a spreadsheet that contains all homepages so http://www.example.com/[username]. the place for this is in my last column labelled $row['username'] and I want to concatenate the base URL around this.
Second, (This is icing on the cake if it is possible) Is there anyway using this simple code to make the columns sortable by clicking on the column header?
The code I have for the table is below. Sorry I am new to all of this and trying to pick it up as quick as possible.
<?php
mysql_connect('host', 'user', 'password') or exit(mysql_error());
mysql_select_db('database') or exit(mysql_error());
$result = mysql_query('SELECT * FROM table ORDER BY firstname') or exit(mysql_error());
echo '<table width="50%" border="0">';
echo '
<tr><th>Last Name</th><th>First Name</th><th>E-Mail Address</th><th>Homepage</th></tr>';
while ($row = mysql_fetch_array($result))
{
echo '
<tr bgcolor="#eeeeee"><td><div align="center"><span class="black_text">' . $row['firstname'] . '</span></div></td>
<td><div align="center"><span class="black_text">' . $row['lastname'] . '</span></div></td>
<td><div align="center"><span class="black_text">' . $row['email'] . '</span></div></td></tr>
<td><div align="center"><span class="black_text">' .'$row['username'] . '</span></div></td></tr>
';
}
echo '</table>';
?>