yer but c++ is first

is this an ok tutorial ??
CODE
// a table i created to show users
// it shows 20 users per page
//it will show the next 2 and previous 2 pages in the links along with the last page and a next and previous button
$max = 20; //amount of users per page. change to what you want
$users = $_GET['users'];
if(empty($users))
{
$users = 1;
}
$limits = ($users - 1) * $max;
//view the users
if(isset($_GET['items']) && $_GET['items'] == "view"){
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM members");
while($r = mysql_fetch_array($sql)){
$id = $r['id'];
$user = $r['username'];
$rank = $r['rank'];
echo "<div><p>$id</p><p>$user</p><p>$rank</p></div>";
}
}else{
//select all the users
$sql = mysql_query("SELECT * FROM members LIMIT ".$limits.",$max") or die(mysql_error());
//count how many users there are
$totalres = mysql_result(mysql_query("SELECT COUNT(id) AS tot FROM members"),0);
//the total number of pages (calculated result), math stuff...
$totalpages = ceil($totalres / $max);
//starts the table
//show the titles for each column
echo "
<table id='users' height='20%' width='35%' border='1'>
<tr>
<td colspan='3'>
<center>
users
</center>
</td>
</tr>
<tr>
<td width='25%'>
<center>
userid
</center>
</td>
<td width='45%' >
<center>
username
</center>
</td>
<td width='30%'>
<center>
rank
</center>
</td>
</tr>";
if($totalres < 1){//if there is no data in the database echo Where'd everyone go !!!
echo "<tr><td colspan=\"3\"><center>Where'd everyone go !!!</center></td></tr></table>";
}else{
while($r = mysql_fetch_array($sql)){//show all the records in the database that match the query
$id = $r['id'];//assigns id from the database to $id
$user = $r['username']; //assigns username from the database to $user
$rank = $r['rank']; //assigns rank from the database to $rank
//show the data in the correct column
echo "
<tr>
<td width='25%'>
<center>
".$id."
</center>
</td>
<td width=\"45%\">
<center>
".$user."
</center>
</td>
<td width=\"30%\">
<center>
".$rank."
</center>
</td>
</tr> ";
}
$prev_page = $users - 1;
echo "<tr><td colspan='3'>";
if($prev_page >= 1){
echo "<b><< <a href=users.php?users=$prev_page>Prev.</a></b>"; //if you are on page 2 or more display a previous link
}
if($totalpages <= 3){
//this is the pagination link
for($i = 1; $i <= $totalpages; $i++){
echo "<a href='users.php?users=$i'> $i </a>| ";//if there are less than 3 pages just show 1|2|3
}
}else{
$twobefore = $users-2;
$onebefore = $users-1;
$oneafter = $users+1;
$twoafter = $users+2;
//i prefer using a nested version as i understand it easuier you could just as easily use an elseif formula
if($twobefore >= 1){
echo "<a href=users.php?users=$twobefore> $twobefore </a>";//if you are on page 3 or more show a link to the previous 2 pages
if($onebefore >= 1){
echo "<a href=users.php?users=$onebefore> $onebefore </a>";//if you are on page 2 or more show a link to the previous page
echo "<a href=users.php?users=$user> $user </a>"; // show the link for the page you are currently on
if($oneafter <= $totalpages){
echo "<a href=users.php?users=$oneafter> $oneafter </a>";// if you are more than 1 page off max pages show link to next page
if($twoafter <= $totalpages){
echo "<a href=users.php?users=$twoafter> $twoafter </a>";// if you are more than 2 page off max pages show link to the next 2 pages
if($twoafter < totalpages){
echo "...<a href=users.php?users=$totalpages> $totalpages </a>";//show a link to the last page
}
}
}
}
}
$next_page = $users + 1;
if($next_page <= $totalpages) {
echo"<a href=users.php?users=$next_page><b>Next</b></a> <b>>></b>";//next link
}
}
//close up the table
echo "</td></tr>";
echo "</table>";
}
}