Quote:
Originally Posted by Catralkid
Hi,
Is there any way of getting a list of members for my site and how many invites that they have. V 7.2
|
Try this but it might not work
Code:
<?
include "include/ts_functions.php";
if (isset($_GET["action"])){$lim = $_GET["action"];}else{$lim = "10";}
$result = sql_query("SELECT * FROM users ORDER BY class DESC,invites LIMIT 10");
echo "<table width='100%' cellspacing='4' cellpadding='4'>
<tr>
<th>name</th>
<th>Registered</th>
<th>Last Login</th>
<th>Last Access</th>
<th>invite</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['added'] . "</td>";
echo "<td>" . $row['last_login'] . "</td>";
echo "<td>" . $row['last_access'] . "</td>";
echo "<td>" . $row['invites'] . "</td>";
echo "</tr>";
}
Or try this
Code:
if (isset($_GET["action"])){$lim = $_GET["action"];}else{$lim = "10";}
$db=mysqli_connect("localhost","root","PASSWORD","DB_NAME");
$result = mysqli_query($db,"SELECT * FROM users ORDER BY class DESC,invites LIMIT $lim");
echo "<table width='100%' cellspacing='4' cellpadding='4'>
<tr>
<th>name</th>
<th>Registered</th>
<th>Last Login</th>
<th>Last Access</th>
<th>invites</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['added'] . "</td>";
echo "<td>" . $row['last_login'] . "</td>";
echo "<td>" . $row['last_access'] . "</td>";
echo "<td>" . $row['invites'] . "</td>";
echo "</tr>";
}
echo "</table>";
remember if you are going to use the second one, you will need to add your db info
If you want more results then do the following..
Code:
/filename.php?action=1000
and change the number to how many you wont all just add the TS7.2 pager function