Need of a Little Help
Moderator: General Moderators
Need of a Little Help
Hey, I'm making a script right now but im stuck on the members page. I have it listing the roster but now I have to learn how to do this http://www.teamx6.com/roster.php and do the http://www.teamx6.com/roster.php?mid=2 If anyone has any tutorials that can do this please send. Also the number will be the id of the person in the database. Any help would be appreciated.
Just have each member on the roster link to $_SERVER['PHP_SELF'].'?id='.$member['id'] or however your id is stored.
Then when you click it will take you to, for example, roster.php?id=5
Then just have something like :
if(!empty($_GET['id'])){
$sql = "SELECT details FROM members WHERE id=".$_GET['id'];
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res);
//display the details using $row here...
}
Then when you click it will take you to, for example, roster.php?id=5
Then just have something like :
if(!empty($_GET['id'])){
$sql = "SELECT details FROM members WHERE id=".$_GET['id'];
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res);
//display the details using $row here...
}
I did this, I canged the html into includes so its not as long
Code: Select all
<?php
if(!isset($_GETї"id"]))
{include normal.php};
else
{
include "teamprofile.php";
}
?>