tags:

views:

33

answers:

1

I have a code and the way it should work is,when they click on NEW CUSTOMER,it takes them to test1.php where in they enter the details and they hit submit.it saves all the details in properly in the database and when i go back and hit REFRESH ,it should come up with the customer details which they had entered in previously. But what happens is, when i click on the REFRESH,it refreshes the same old page which is empty.I wanted to find out where am i missing the logic.Thanks in advance. The sample code would be

<tr>
    <td class="tdvisitbig" colspan="5">THIS IS A TEST</td>
</tr>



 <tr>
 <td class='tdvisitbig' colspan="5"><input type="button" onClick="openVisit('test1.php?id=<?=$key?>&name=<?=$name?>');return false;" value="NEW CUSTOMER" class="submit">&nbsp;<input type="button" value="REFRESH" name="add_xyz" class="submit" onClick="document.add.target='_self';document.add.action='test3.php?redirect=visit&section=test page';document.add.submit();"></td>
 </tr>
<?

$q = "SELECT address,customernum,status FROM customer WHERE name='$name' ORDER BY customernum";
$r = mysql_query( $q , $Link );
while( $rw = mysql_fetch_assoc( $r ) )
{
    extract( $rw );

    ?>
 <tr>

 <? } ?>
A: 

Your code sample doesn't have any code to display each customer. If you had three customers in the database, I would expect to see your web page end like this:

 <tr>
 <td class='tdvisitbig' colspan="5"><!-- the buttons for adding a new customer --></td>
 </tr>
 <tr>
 <tr>
 <tr>

The extract method just loads the fields into local variables. It doesn't display anything.

Don Kirkby