Location: PHPKode > projects > deltasql > deltasql-1.0.8/list_users.php
<?php session_start(); ?>
<title>deltasql - Users</title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
$myrights = $_SESSION["rights"];
if ($myrights<2) die("<b>Not enough rights to list all users</b>");
<a href="index.php">Back to main menu</a>

<h4>All users</h4>
<table border="1">

mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");

$query="SELECT * from tbuser ORDER BY last ASC"; // query che ti trova tutti i record e li mette in una variabile speciale
$result=mysql_query($query);   // che si chiama $result

echo "<tr>

while ($i<$num) {  // loop che passa attraverso tutti i record uno alla volta

$username=mysql_result($result,$i,"username");           // mettiamo nelle variabili seguenti il contenuto di un record (=linea)

echo "

if ($rights==1) {
   echo "Developer";
} else
if ($rights==2) {
   echo "Project Manager";
} else
if ($rights==3) {
   echo "Administrator";
echo "

echo "<td>";
if ($myrights==3) echo "<a href=\"edit_user.php?id=$id&username=$username&rights=$rights&first=$first&last=$last&email=$email\">Edit</a> ";
if (($myrights==3) && ($username!="admin")) {
    echo "<a href=\"delete_user_confirm.php?id=$id&name=$encoded_name\">Delete</a> ";
echo "</td>";
$i++; // $i=$i+1;

<a href="index.php">Back to main menu</a>
Return current item: deltasql