title: How could I run a while loop to update records in my table in phpMyAdmin?
body: <p>I'm using MySQL, of course.</p>
  
  <p>However, I'm unable to run any while loop in the text box in the browser to update records in a table - I'm getting an error.</p>
  
  <pre><code>DECLARE @count INT
  SET @count = 0 
  WHILE @count &lt;2000 DO
      /* loop logic in here */
      SET @count = @count + 1;
  END WHILE;
  </code></pre>
  
  <p>Is the above code wrong?</p>
  
  <p>Here is the error:
  <img src="https://i.stack.imgur.com/9bbdn.png" alt="enter image description here"></p>
  
  <blockquote>
    <p>MySQL said: </p>
    
    <h1>1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use</h1>
    
    <p>near 'DECLARE @count INT SET @count = 0  WHILE @count &lt;2000 DO
        SET @count = @co' at line 1</p>
  </blockquote>