Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 4th, 2004, 01:56 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.




Code:
<html><head><title>test</title>
<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}
</style>
</head>
<body>


<?php
$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)))
die("error");

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

?>


<table>
<tr>
<?php

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

<?php
}
?>
</tr>



<?php

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>";

}
?></tr><?php
}
?>

</table>
</body>
</html>
Reply With Quote
  #2 (permalink)  
Old October 5th, 2004, 03:50 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I use this for my url links from a database:

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

Michael.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save (output to) multiple files from single click moo_desanta Classic ASP Basics 2 June 23rd, 2006 02:00 AM
ASP.Net Single Single-on with Oracle Application S guhanath Oracle 0 October 6th, 2004 05:05 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM
Delet contents of a single cell marmer Classic ASP Basics 1 August 27th, 2003 08:14 PM
Multiple file input single file output.... jdm_mboy Biztalk 1 July 2nd, 2003 03:35 AM



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


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