title: How can I update my database table with the result of my query
body: <p>I am a French designer and I have a SQL problem. My MySQL server is in v5.6 and i ask for help because I have a syntax problem. I think you can bring me a solution.</p>
  <p>I have a data base called &quot;scores&quot;:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>pseudo</th>
  <th>tempsstage1mili</th>
  <th>rangstage1</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>pseudo1</td>
  <td>20100</td>
  <td>---</td>
  </tr>
  <tr>
  <td>2</td>
  <td>pseudo2</td>
  <td>16900</td>
  <td>---</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>and I ask this to MySQL :</p>
  <pre><code>SELECT pseudo,
   @curRank := @curRank + 1 AS rank
  FROM scores p, (SELECT @curRank := 0) r
  ORDER BY  tempsstage1mili;
  </code></pre>
  <p>With this command, MySQL return this :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>pseudo</th>
  <th>rank</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>pseudo2</td>
  <td>1</td>
  </tr>
  <tr>
  <td>pseudo1</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>At this step it's perfect but now, I want to Update my table called &quot;scores&quot; with the result. The column I have to Update is called &quot;rangstage1&quot; with the column &quot;rank&quot;</p>
  <p>I want to get that :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>pseudo</th>
  <th>tempsstage1mili</th>
  <th>rangstage1</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>pseudo1</td>
  <td>20100</td>
  <td>2</td>
  </tr>
  <tr>
  <td>2</td>
  <td>pseudo2</td>
  <td>16900</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Could you help me ? Please ? You are hope !</p>
  <p>Thank you !</p>