PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 15th, 1999, 01:09 PM
g_kas
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I'm trying to insert a link into a table that is generated through a MySQL Query.

Here's the code:

<?
error_reporting(0);
include "auth.php";
MySQLConnect("Error Connecting",
"Temporarely unavailable.");

$result = MySQLQuery("select * from bizfile order by name",
"Error Selecting",
"Temporarely unavailable.");

// create header row
print("<tr>n");
print("<td><b>Name</b></td>n");
print("<td><b>City</b></td>n");
print("<td><b>Type</b></td>n");
print("</tr>n");


// get each row
while($row=mysql_fetch_array($result))
{
$id=$row[0];
$name=$row[1];
$city=$row[2];
$type=$row[3];

print("<tr>n");

print("<td>$name</td>n");
print("<td>$city</td>n");
print("<td>$type</td>n");

print("<tr>n");
}
?>

What I'd like is a link at the end of each table row which would load a page with information relevant to that database row. For example, if the main table lists business establishments, the link would set-up a page which includes the businesses address as well as relevant financial information.

I tried inserting into the prints the following line:

print("<td><a href="$id.htm"> Test </a></td>n");

but.... didn't work

Can anyone help???

Thanks in advance....

Reply With Quote
  #2  
Old November 15th, 1999, 01:37 PM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Change this line:

print("<td><a href="$id.htm"> Test </a></td>n");

to:

print("<td><a href="$id.htm"> Test </a></td>n");

Reply With Quote
  #3  
Old December 1st, 1999, 05:41 PM
jcommand
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
If the last method didn't work, change:

print("<td><a href="$id.htm"> Test </a></td>n");

to:

print("<td><a href="" . $id . ".htm"> Test </a></td>n");

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Inserting link into a table generated from MySQL

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap