Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

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 Codewalkers Forums Sponsor:
  #1  
Old August 30th, 2003, 08:20 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Need help with returning a db querry as a link

HI, I have a question about returning a database querry as a link, I have a DB with 3 colums, one of them in named ID. I have it so that the data returned is a link, and it has the link and adds the number from the id column on the end. Now my question, how can I make it so that it just returns the value of the db as a link WITHOUT putting the name of the link? By this I mean lets say on of the filed has the name John in it, the I would like the name John to show up on the page, as a link. Here is my code so that maybe It will clarify what i am saying,

{
echo "<TR><TD>".$myrow["name"]." ".$myrow["score"]."<TD>".$myrow["team"];
echo "<TD><a href="team_info.php?id=".$myrow[id]."">Info</a>";
}

now notice it will return a link on the end that says Info that links to the team_info page. BUT I want to do away with that and just have the name be the link to the team_info page, but since its a loop i can't just specify what the name is like i am doing now.

I hope I explained that ok, i have seen this done but can't figure out how to do it

Reply With Quote
  #2  
Old August 31st, 2003, 05:55 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,323 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 20579 Folding Title: Starter FolderFolding Points: 20579 Folding Title: Starter Folder
Time spent in forums: 6 Days 10 h 53 sec
Reputation Power: 4
RE: Need help with returning a db querry as a link

So you want the name to be where text "info" is now? That's too easy:

php Code:
Original - php Code
  1.  
  2. {
  3. echo "<TR><TD>".$myrow["name"]." ".$myrow["score"]."<TD>".$myrow["team"];
  4. echo "<TD><a href="team_info.php?id=".$myrow[id]."">".$myrow["name"]."</a>";
  5. } 

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Need help with returning a db querry as a link


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT