I want to understand how to pass any variable betwen functions with PHP. Could anyone make it easy for me to understand please as I want the 'id' field? basically I have a list of records an a click to edit button. This brings up the editor. All works except for the WHERE statement whih does not get the $idDetails value.

<?php function showroweditor($row)
global $idDetails;
echo $idDetails; //this works
<table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
<td><? echo htmlspecialchars("REF")."&nbsp;" ?></td>
<td class="dr"><input type="text" name="id" maxlength="30" value="<? echo str_replace('"', '&quot;', trim($row["id"])) ?>"></td></tr>

<? function editrec($recid)
global $idDetails;

<form action="garant.php" method="post">
<input type="hidden" name="sql" value="update">
<input type="hidden" name="xid" value="<? echo $row["id"] >">
<? showroweditor($row) ?>
<p><input type="submit" name="action" value="POST"></p>

function sql_update()
global $idDetails;
$sql = "update `Garant` set
`id`=" .sqlvalue(@$_POST["id"], true) ."
where id = '$idDetails' ";

Hope that you understand. Thanks in advance for anyone's time and effort.

$idDetails = $_POST; can get this from the form after submit