title: PHP: can variables and arguments get mixed up if they share the same name?
body: <p>There are 2 places where $account_name occurs in my code, one where is the name of an argument of a function:</p>
  
  <p>functions.php:</p>
  
  <pre><code>function getAccountID ($account_name) {
      $account_id = mysql_query("SELECT account_id FROM accounts WHERE account_name = '$account_name'");
      $account_id = (mysql_fetch_assoc($account_id)); 
  }
  </code></pre>
  
  <p>and the other where it is a variable with a value</p>
  
  <p>index.php:</p>
  
  <pre><code>$account_name = $fileop[0];
  $account_id = getAccountID($account_name);
  </code></pre>
  
  <p>I am aware that the two instances of the variable have completely separate uses: the first is just a placeholder for the function to take an argument, and the second carries a value outside the function's scope. I am trying to simplify things as much as possible which is why I would like them to be the same. Does this work and if so is it acceptable practice?</p>