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