Jump to content

[SOLVED] Any help appreciated


Greaser9780

Recommended Posts

I have a php file that lists all of the registered clans and some of their stats in a ranked order. In the section of the table where I list the clan name , I wish for it to display the clan name as a link to a php file that will query all of that clans history,stats,logo etc.  First off I have no clue how to display a link in php. I have tried numerous ways to do this in html but since it is in the middle of a while statement in php it won't let me. Second I am guessing the link would have to connect to a script such as stats.php that would query the db for the info for the clan name you clicked on and then display it in a series of tables.

 

Anyone have any ideas on any parts of this?

Link to comment
https://forums.phpfreaks.com/topic/38906-solved-any-help-appreciated/
Share on other sites

what you need to do is pull back the clan's id. when you go to display the clan's name do this

 

echo "<a href=\"clan_info.php?id=". $row['id'] ."\">". $row['clan'] ."</a>";

 

or however you build your table cells.

 

then on clan_info.php do a query using the id var from the link

 

$id = $_GET['id'];

 

$query = "SELECT fields FROM table WHERE id = ". $id;

 

then display the info

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.