Jump to content

Members page.


Jacbey

Recommended Posts

Hi Guys,

 

I was wondering how I could wrap my members page so that only 5 members appear at a time and you have to click the next button to go onto the next page. Here is the current code.

 $userid = $_SESSION['userid'];

$query = "SELECT username, first_name, last_name, password, email, dob, mob, yob, year, gender FROM spotty WHERE user_id = '" . $userid . "'";

$query2 = "SELECT user_id FROM spotty WHERE user_id = '" . $userid . "'";

$result = mysql_query($query) or die('Error Getting Information Requested');

$result2 = mysql_query($query2) or die('Error Getting user_id');

$row = mysql_fetch_array($result);

$row2 = mysql_fetch_array($result2);

//$result = mysql_query($query);

$num = mysql_num_rows($result2);
$username = $row['username'] ;


if($_SESSION['userid'] == NULL)
{
echo "Sorry, wrong username or password. You will be redirected in 5 seconds.";
echo "<meta http-equiv='refresh' content='7;url=http://www.klueless.net/daisysite'>";
}
else
		{
echo "Members.";
echo "<br />";

$membsquery="SELECT * FROM spotty WHERE showmem = '0'";
$membs=mysql_query($membsquery);

$num=mysql_numrows($membs);
$membresult = mysql_result($membs,$i,"user_id");
$useridname = $membresult['username'];


echo "<br /> <br />" ;

echo "<table border='0' cellspacing='2' cellpadding='2'> <tr>
<font face='Comic Sans MS, cursive'>Click on a username to see their profile.</font>
<br />
<br />
</tr>";

$i = 0;
while ($i < $num) {


$f1 = "<font face='Verdana, Geneva, sans-serif'><a href='profile.php?id=" . mysql_result($membs,$i,"user_id") . "'>" . mysql_result($membs,$i,"username") . "</a><br /><br />";


echo "<tr>
<td>" .  $f1 ."</font></td>
</tr>
</table>" ;
$i++;
}
		}

mysql_close()


?> 

 

Thanks in advance!  8)

 

 

Link to comment
https://forums.phpfreaks.com/topic/237160-members-page/
Share on other sites

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.