Okay
I have a Members feature on my Community System, when you click a member it returns as only the members name, not any of the other members.
But I want it to when clicked to display some information from a MySQL Database
Iv tried this code but it doesn't display anything!!
Anybody got any ideas?Code:<!-- Copyright Jacob Clark 2010 | Fusion Strike Studios and Network --> <!-- Fusion Strike; Live! Was Developed In Loving Memory Of Frederick Clark --> <!-- Please Do Not Remove These Comments --> <?php include "config.php"; ?> <html> <head> <title>Fusion Strike; Live!</title> <link rel="stylesheet" href="style.css" type="text/css" > </head> <body> <img src="images/logo.png"> <br> <div id="page-wrap"> <h4> <?php include "bloginfo.php"; ?> </h4> <h6> <?php include "navigation.php"; ?></div></h6> <div id="page-wrap"> <?php //Defines the function that will allow us to display only one post on click function get_content($id = '') { //Gets the ID number from the SQL Database if($id !=""): $id = mysql_real_escape_string($id); $sql = "SELECT * FROM regusers where id = '$id'"; else: //If we dont specifiy an ID display everything $sql = "SELECT * FROM regusers "; endif; //If there was an error display it $res = mysql_query($sql) or die(mysql_error()); //This IF statment decides wether the ID tag you have enterd exists or not, if it does it //displays the post, if it doesnt it displays an error message if(mysql_num_rows($res) != 0): //How to display the posts while($row = mysql_fetch_assoc($res)) { //Makes posts titles into links echo '<p><a href="members.php?id=' . $row['id'] . '">' . $row['username'] . '</a></p>'; } else: echo '<p>Oh Dear, This Is Embarrassing, It seems we cant find what your looking for!</p>'; endif; } //Ends Our Class //Displays the posts if(isset($_GET['id'])): get_content($_GET['id']); $id = ($_GET['id']); $sql = "SELECT * FROM regusers where aboutme = '$id'"; $res = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($res)or die(mysql_error()); echo $row['aboutme']; else: get_content(); $result = mysql_query("SELECT * FROM regusers"); $num_rows = mysql_num_rows($result); echo "<h6>We have <b>$num_rows</b> registerd members</h6>"; endif; ?> </div> <br> <?php include "footer.php"; ?>
Thanks!!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks