I'm a little over my head with this operation, so to begin, I apologize if I can't explain it all that well. I have the following code which brings up a table.
<?php
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<tr><td colspan=3 align=center><font size=5><a href=".$row["Description"].">". $row["Company"]. "</a><b>, </b></font><font size=4><b>(</b>". $row["Ticker"]. "<b>)</b></font></td></tr>";
echo "<tr><td><b>Sector - </b>". $row["Sector"]. "</td>";
echo "<td><b>Country - </b>". $row["Country"]. "</td>";
echo "<td><b>Index - </b>". $row["Index1"]. "</td></tr>";
echo "<td><b>Industry - </b>". $row["Industry"]. "</td>";
echo "<td><b>Currency - </b>". $row["Currency"]. "</td>";
echo "<td><b>Alt. Index - </b>". $row["Index2"]. "</td></tr>";
echo "<tr><td colspan=3><b>Competitors - </b>". $row["Competitor"]. "<b>, </b>". $row["Competitor2"]. "<b>, </b>". $row["Competitor3"]. "<b>, </b>". $row["Competitor4"]. "<b>, </b>". $row["Competitor5"]. "<b>, </b>". $row["Competitor6"]."</td></tr>";
echo "<tr><td><b>Corporate Status - </b>". $row["CorporateStatus"]. "</td>";
echo "<td><b>Alt. Symbol - </b>". $row["Ticker2"]. "</td>";
echo "<td><b>Financial Units - </b>". $row["FinUnits"]. "</td></tr>";
$IDNumber = $row['IDNumber'];
}
echo "</table>";
What I would like to do here is have the various Competitor entries serve as a link of sorts. The problem is, there is nothing to link to. I would like for each entry to appear as a hyperlink, but upon clicking on it, it would actually refresh the page and start a session around the new Competitor company name. Here is my session code from earlier in the page.
<?php
session_start();
if(isset($_SESSION['IDNumber']) && (!isset($_POST['Ticker']) || !$_POST['Company'])) {
$IDNumber = $_SESSION['IDNumber'];
}
else {
$IDNumber = "";
$Ticker = $_POST['Ticker'];
$Company = $_POST['Company'];
}
$db = mysql_connect('host', 'username', 'password') or die("Error - cound not connect to server");
$er = mysql_select_db('prent32_FinDat') or die("Error - cound not connect to database");
if (isset($_POST['Ticker']) || isset($_POST['Company']) && $IDNumber=="") {
$result = mysql_query("SELECT * FROM General WHERE Ticker = '$Ticker' or Company = '$Company'") or die(mysql_error());
}
else if ($IDNumber!="") {
$result = mysql_query("SELECT * FROM General WHERE IDNumber = '$IDNumber'") or die(mysql_error());
}
$num_rows = mysql_num_rows($result);
if ($num_rows <=0)
?>
So, does this make any sense, and is it at all possible?