Php variable precendence
<p>I've one issue about php variable. Let's example:</p>

<p>This is my while loop which i want to edit user contact list. </p>

<pre><code>$sql = mysql_query("SELECT * FROM addcontacts WHERE name LIKE 'a%' AND uname = 
'$uname'");

while($re = mysql_fetch_array($sql))
{
$id = (int) $re['id'];  
$name = mysql_real_escape_string(htmlspecialchars(trim($re['name'])));
$surname = mysql_real_escape_string(htmlspecialchars(trim($re['surename'])));
$group = mysql_real_escape_string(htmlspecialchars(trim($re['group'])));
$email =  mysql_real_escape_string(htmlspecialchars(trim($re['email'])));
$skype = mysql_real_escape_string(htmlspecialchars(trim($re['skypeid']))); 
$facebook = mysql_real_escape_string(htmlspecialchars(trim($re['facelink']))); 
$twitter = mysql_real_escape_string(htmlspecialchars(trim($re['twitterlink'])));
$aim = mysql_real_escape_string(htmlspecialchars(trim($re['aimid'])));
$myspace = mysql_real_escape_string(htmlspecialchars(trim($re['myspacelink'])));
$notes = mysql_real_escape_string(htmlspecialchars(trim($re['specialnote'])));

more code......
?&gt;
</code></pre>

<p>So my questions is, Is there anyway to access this <strong>$id</strong> before <strong>$sql</strong> query ? I need this <strong>$id</strong> value to the top of the form because of there are a button name: Edit Contacts. So if i get this <strong>$id</strong> value then i can edit user contact list.</p>
