I need to link one specific cell in a mySQL table when calling all results....if this makes any sense. So for example, SELECT * FROM filemanager would be my sql statement. and in the table filemanger is Title, Filename, Size, Date.
I want to print out the results, but then make the Filename a link so when you click it, it will take you to that file. How do I do this? I can get the rows to print out, but not just one specific "cell".
<?php
$linkID = @mysql_connect("host", "username", "password");
mysql_select_db("databasename", $linkID);
$resultID = mysql_query("SELECT * FROM filemanager", $linkID);
print "<table border=1><tr><th>Title</th><th>Filename</th>";
print "<th>Filesize</th><th>Date</th>";
$alternate = "2";
while ($row = mysql_fetch_row($resultID))
{
if ($alternate == "1")
{
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#c0c0c0";
$alternate = "1";
}
print "<tr bgcolor=$color>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close($linkID);
?>
I want to print out the results, but then make the Filename a link so when you click it, it will take you to that file. How do I do this? I can get the rows to print out, but not just one specific "cell".
<?php
$linkID = @mysql_connect("host", "username", "password");
mysql_select_db("databasename", $linkID);
$resultID = mysql_query("SELECT * FROM filemanager", $linkID);
print "<table border=1><tr><th>Title</th><th>Filename</th>";
print "<th>Filesize</th><th>Date</th>";
$alternate = "2";
while ($row = mysql_fetch_row($resultID))
{
if ($alternate == "1")
{
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#c0c0c0";
$alternate = "1";
}
print "<tr bgcolor=$color>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close($linkID);
?>