p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning PHP (http://p2p.wrox.com/forumdisplay.php?f=95)
-   -   help with single cell output (http://p2p.wrox.com/showthread.php?t=19372)

surethg October 4th, 2004 01:56 PM

help with single cell output
ok i have a access database that i'm pulling info from,
in the database there are 3 fields; name, location, files.

the last field, "files" contains a path to a file on the server.
what i want to do is make it so that when it displays the third field
from the table that the path name is a hyperlink instead of just
the plain old path location. this is as far as i have gotten with code. any help or links or examples would help a huge ammount.


<style type="text/css">
th {color: white; background-color: gray; font-family:arial; font-size: 9pt}
td {background-color: #c0c0c0; font-family:arial; font-size: 9pt}

$odbc_dsn = "phpaccess";
$odbc_userid = "";
$odbc_password = "";

$query ="SELECT * From Table1";

if(!($odbc_db = odbc_connect($odbc_dsn, $odbc_userid, $odbc_password)))
die("not connected");

if(!($odbc_rs = odbc_do($odbc_db, $query)))

$num_cols = odbc_num_fields($odbc_rs);
if($num_cols < 1) die("empty");



for($a = 1; $a <= $num_cols; $a++)
<th><b> <?php
echo odbc_field_name($odbc_rs, $a);



while(odbc_fetch_row($odbc_rs)) {

?> <tr> <?php

for($a = 1; $a <= $num_cols; $a++) {

$data = odbc_result($odbc_rs, $a);
echo "<td>$data</td>";



mikeuk October 5th, 2004 03:50 AM

I use this for my url links from a database:


echo "<a href=\"$file_path/$filename\" target=\"_popUp\" title=\"Click here to view $filename\">Open file $filename </a>";
Hope this helps.


All times are GMT -4. The time now is 01:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.