How can I improve this PHP MySQL rank query?
DO NOT USE THE mysql_* FUNCTIONS!
They are DEPRECATED.

&lt;?php if ($row_ranks['padric'] == '1' ) {
  echo ('&lt;li&gt;&lt;a href=&quot;padroncini_ric.php&quot;&gt;Ricerca&lt;/a&gt;&lt;/li&gt;');
      } 
      else  {
      echo ('&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;disabled&quot;&gt;Ricerca&lt;/a&gt;&lt;/li&gt;');
      } 
?&gt;

Your indentation style is a mess, decide what indentation style to use and if to use tabs or spaces (and if yes how many) and then stick to it:
&lt;?php
    if ($row_ranks['padric'] == '1' ) {
        echo '&lt;li&gt;&lt;a href=&quot;padroncini_ric.php&quot;&gt;Ricerca&lt;/a&gt;&lt;/li&gt;';
    } else  {
        echo '&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;disabled&quot;&gt;Ricerca&lt;/a&gt;&lt;/li&gt;';
    } 
?&gt;

Normally there's also no space between the line and the closing semicolon.
Additionally the echo function does not need any parentheses.

if ($row_ranks['padric'] == '1' )

If your code is in your native language, please always convert it to English before posting it here for review. It makes things easier for us.
Now what you use here is called a magic string or magic number, it's a fixed value that has some meaning but does not provide any explanation what's-o-ever what that meaning is or why it is that way. Use named constants instead.
const SOME_CONDITION = &quot;1&quot;; // Change the name to something meaningful.

if ($row['padric'] == SOME_CONDITION) {

Also do you now the difference between the equality and identity operator? The equality operator == will perform casting as needed which can yield interesting effects, the identity operator === on the other hand will also compare the types.
Some examples:
0 == 0     --&gt;  true
0 == &quot;0&quot;   --&gt;  true
0 == &quot;&quot;    --&gt;  true
0 == NULL  --&gt;  true

0 === 0     --&gt;  true
0 === &quot;0&quot;   --&gt;  false
0 === &quot;&quot;    --&gt;  false
0 === NULL  --&gt;  false

So always sue === unless you have a compelling reason not to.

$_POST[$field] = '0' ;

First of all, global variables are bad. And after that, writing into the Super-Globals is a bad idea for many reasons. Nobody expects that super globals are modified in any way and that can lead to funny errors which you'll be looking for for days.
Extract the values from the super globals and work with that variable.

$updateSQL = sprintf(&quot;UPDATE ranks SET $field='&quot;.$_POST[$field].&quot;' WHERE userID='&quot;.$_POST['ID'].&quot;'&quot;); // set privileges for user

One word (okay, it's two): SQL Injection. There is no, absolutely no (and I mean no) excuse to allow SQL injection. Imagine somebody would manipulate the POST request to contain the value '; DROP TABLE ranks; -- which will yield the query:
UPDATE ranks SET field='field' WHERE userID=''; DROP TABLE ranks; --'

...any questions?
Why are you using sprintf here?

$row_RSfields = mysql_fetch_assoc($RSfields);
do {
    // code 
} while ($row_RSfields = mysql_fetch_assoc($RSfields));

Traditionally it's a while loop:
$result = getResult();
while ($row = fetchRow($result)) {

}


Now let's get to the core problem: You are using the mysql_* functions. You should either use mysqli_* or PDO.
Personally I prefer PDO over mysqli_* because it has an object oriented interface and support multi-statements. So here's an example on how to use PDO:
/**
 * 
 * @var PDO
 */
$pdo = new PDO($dsn, $user, $password, $options);
$pdo-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // See footnote!

/**
 *
 * @var PDOStatement
 */
$statement = $pdo-&gt;prepare(&quot;SELECT field FROM table WHERE id = :id;&quot;);
$statement-&gt;bindValue(&quot;:id&quot;, $id, PDO::PARAM_INT);

$statement-&gt;execute();

while ($row = $statement-&gt;fetch()) {
    echo $row['field'];
}

$statement-&gt;closeCursor();

Question on Stack Overflow about when to turn off emulated prepares.

Are you aware of the difference between strings?
'A simple string'
&quot;A string with automatic $variable expansion&quot;