I'm trying to get a search from a database automatically convert one column into a URL.
I've tried a few different things, but no success. I tried converting the variable before it's printed, but that doesn't work (at least not the way I am doing it).
Below is the code that I'm using that currently selects the data & spits it out into a table format. I want the id column to be linked to the URL.
<?
while($value = mysql_fetch_array($result))
{
print "<tr ALIGN=CENTER>";
//This loop goes through the columns and prints
//each value
for($i=0; $i< mysql_num_fields($column); $i++ )
{
if ($value[$i] < 4000) {
echo "<td ALIGN=LEFT VALIGN=TOP><h4> $value[$i] </td></h4>";
}
elseif ($value[$i] > 4000) {
$value[$i]=number_format($value[$i],2,".",",");
echo "<td ALIGN=LEFT VALIGN=TOP><h4> $$value[$i] </td></h4>";
}
else {
echo "<td ALIGN=LEFT VALIGN=TOP><h4> %$value[$i] </td></h4>";
}
}
print "</tr>";
}
$num = mysql_num_rows($result);
mysql_free_result($result);
mysql_close();
?>
Thanks for any help.
Jason Martin