View Single Post
  #1 (permalink)  
Old February 16th, 2007, 08:09 PM
dgreep dgreep is offline
Registered User
 
Join Date: Feb 2007
Location: Hidden Valley Lake, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding varchar string to hyperlink

I'm trying to design a drilldown page using data queried from an oracle db. I would like to display the data from two columns at the end of the link to take the user to a map of the location. One problem I have is the data displayed in the link shows only the first word in the string. The other problem is how do I add the results of two columns to the link. This is what I'm working with:

$query = "select * from adr_main";



$result = Ora_Parse($cursor, $query);

if ($result == false){
  echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";

  exit;
}

$result = Ora_Exec ($cursor);

if ($result == false){
    echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";

  exit;
}


echo "<table align=\"center\" border=1>";
echo "<th colspan=\"6\"><h2>Cost Center Information For:</h2></th>";
//****************Column Names*******************************
$numcols = ora_numcols($cursor);
echo "<tr>";
for($column=0; $column < $numcols; $column++){
    $data = trim(Ora_ColumnName($cursor, $column));
    echo "<td><b>" . $data . "</b></td>";
}
echo "</tr>";
//************************************************** **********


//****************Cell Data***********************************
while(ora_fetch($cursor)){
   echo "<tr>";
   for($column=0; $column < $numcols; $column++){
        $data = (ora_getcolumn($cursor, $column));
        if($column == 6) $data = "<a href=http://www.google.com/maps?q=".$data.">" . $data . "</a>";
        if($data =="") $data = " ";
        echo "<td>" . $data . "</td>";
    }
    echo "</tr>";
}
//************************************************** ********



echo "</table>";

Ora_Close ($cursor);
Ora_Logoff ($connection);
?>


Thanks for any help you can provide!
Reply With Quote