saik0v Posted January 16, 2007 Share Posted January 16, 2007 Hello,using this simple script that takes an HTML variable from an <input> textfield or a <select> drop down list. Checks if that variable is available in the DB , if yes it then echos the result in a table.The results are NAME and LOCATION. It works fine.My problem is that I am trying to get this : echo "<td>".$results["NAME"][$i]."</td>"; to appear as a link. How can I do this?I tryied things like : echo "<td><a href=".$results["NAME"][$i]."</a></td>" which is obviously wrong.Thanks in advance for any help ! here's the code <?php $NomosTo = $_POST["NomosTo"]; $db_conn = ocilogon("system", "getinthere" , "//localhost/XE") or die( "ERROR : Unable to connect to RemoteHost"); if ($NomosTo != 'Attiki'){ $cmdstr = "select * from NOMOS where NAME = '$NomosTo' " ; $parsed = ociparse($db_conn, $cmdstr); ociexecute($parsed); $nrows = ocifetchstatement($parsed, $results) ; echo "<html><head><title>Oracle PHP Test</title></head><body>"; echo "<center><h2>Oracle PHP Test</h2><br>"; echo "<table border=1 cellspacing='0' width='50%'>\n<tr>\n"; echo "<td><b>Name</b></td>\n<td><b>Location</b></td>\n</tr>\n"; for ($i = 0; $i < $nrows; $i++ ) { echo "<tr>\n"; echo "<td>".$results["NAME"][$i]."</td>"; echo "<td>" . $results["LOCATION"][$i] . "</td>"; echo "</tr>\n"; } echo "<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>"; echo "<br><em>If i c data, then it works!</em><br></center></body></html>\n"; } else { echo("No Info Yet"); } ?> Link to comment https://forums.phpfreaks.com/topic/34445-link-in-table/ Share on other sites More sharing options...
saik0v Posted January 16, 2007 Author Share Posted January 16, 2007 [quote author=saik0v link=topic=122679.msg506269#msg506269 date=1168972775]Hello,using this simple script that takes an HTML variable from an <input> textfield or a <select> drop down list. Checks if that variable is available in the DB , if yes it then echos the result in a table.The results are NAME and LOCATION. It works fine.My problem is that I am trying to get this : echo "<td>".$results["NAME"][$i]."</td>"; to appear as a link. How can I do this?I tryied things like : echo "<td><a href=".$results["NAME"][$i]."</a></td>" which is obviously wrong.Thanks in advance for any help ! here's the code <?php $NomosTo = $_POST["NomosTo"]; $db_conn = ocilogon("system", "getinthere" , "//localhost/XE") or die( "ERROR : Unable to connect to RemoteHost"); if ($NomosTo != 'Attiki'){ $cmdstr = "select * from NOMOS where NAME = '$NomosTo' " ; $parsed = ociparse($db_conn, $cmdstr); ociexecute($parsed); $nrows = ocifetchstatement($parsed, $results) ; echo "<html><head><title>Oracle PHP Test</title></head><body>"; echo "<center><h2>Oracle PHP Test</h2><br>"; echo "<table border=1 cellspacing='0' width='50%'>\n<tr>\n"; echo "<td><b>Name</b></td>\n<td><b>Location</b></td>\n</tr>\n"; for ($i = 0; $i < $nrows; $i++ ) { echo "<tr>\n"; echo "<td>".$results["NAME"][$i]."</td>"; echo "<td>" . $results["LOCATION"][$i] . "</td>"; echo "</tr>\n"; } echo "<tr><td colspan='2'> Number of Rows: $nrows</td></tr></table>"; echo "<br><em>If i c data, then it works!</em><br></center></body></html>\n"; } else { echo("No Info Yet"); } ?>[/quote] Link to comment https://forums.phpfreaks.com/topic/34445-link-in-table/#findComment-162201 Share on other sites More sharing options...
saik0v Posted January 16, 2007 Author Share Posted January 16, 2007 answer echo "<td><a href=\"".$results["NAME"][$i]."\">".$results["NAME"][$i]."</a></td>"; cheers anyway ::) Link to comment https://forums.phpfreaks.com/topic/34445-link-in-table/#findComment-162290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.