I've one issue about php variable. Let's example:
This is my while loop which i want to edit user contact list.
$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......
?>
So my questions is, Is there anyway to access this $id before $sql query ? I need this $id value to the top of the form because of there are a button name: Edit Contacts. So if i get this $id value then i can edit user contact list.