Jump to content

Linking to other rows within a table


lukep11a

Recommended Posts

I wonder if anyone can help me, I have a MySQL table of football teams (team_name; link; description; rival_1; rival_2; rival_3;) where each 'team_name' has its own page with the relevant information from the table and is named as the link field from the table. Within each team page I also want to display the rival_1,2 and 3 teams with links to their pages. I know how to just display the information but am struggling with picking up the link from the relevant row in the table. Is this possible or would I be better off just placing a <a href> link around each rival team when I enter it into the MySQL table??

 

I hope this makes sense, any help would be very much appreciated. Thanks

Link to comment
Share on other sites

Can you be more clear on what are you having problems with. Also as i asume rival 1,2 and 3 are also teams, i would recommend to make tWo different tables,  one teams with columns id, team_name, link. And a second one that will be team_rivals that will have just 2 columns that would both be forefinger keys of the team id making a many to many relation to the team table

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.