[FX.php List] Duplicate data

Jane Chinn Jane.Chinn at cwu.EDU
Thu Dec 9 17:14:13 MST 2004


Hi,

I'm just starting to learn FX.php with FMPro7 and am using FX.php in 8 
Hours to learn.  I've adapted the code as I understand it to be for 
FMPro7.  Can anyone tell me why I would get duplicate data when 
submitting a new record with FMPro7.   A new record is created but the 
values appear twice in the database.

Here is the file:

<?php
include_once('FX/FX.php');
include_once('FX/FMErrors.php');
include_once('FX/server_data.php');

$newrecord=new FX($serverIP,$portNumber);
$newrecord->SetDBData('contacts.fp7','main');
$newrecordResult=$newrecord->FMView();

?>

</head>

<body>
<?php
include_once("includes/header.php");
?>
<br>
<form method="post" action="new_response.php">
<table width="500" border="0" cellspacing="3" cellpadding="0">
   <tr class="ver12">
     <td width="50%"><div align="right">First name</div></td>
     <td><input type="text" name="name_first" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Last name</div></td>
     <td><input type="text" name="name_last" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Phone (hm)</div></td>
     <td><input type="text" name="phone_home" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Phone (wk)</div></td>
     <td><input type="text" name="phone_work" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Phone (cell)</div></td>
     <td><input type="text" name="phone_cell" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Address</div></td>
     <td><input type="text" name="address1" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Address2</div></td>
     <td><input type="text" name="address2" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">City</div></td>
     <td><input type="text" name="city" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">State</div></td>
     <td><select name="state">
<?php
foreach($newrecordResult['valueLists']['state'] as $key=>$value){
?>
<option value="<?php echo $value; ?>"><?php echo $value; ?></option>
<?php
}
?>
</select>

</td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Zip/Postal Code</div></td>
     <td><input type="text" name="zip" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Country</div></td>
     <td><input type="text" name="country" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Hotel</div></td>
     <td><input type="text" name="hotel" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Flight in date</div></td>
     <td><input type="text" name="flight_in_date" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Flight in time</div></td>
     <td><input type="text" name="flight_in_time" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Flight out date</div></td>
     <td><input type="text" name="flight_out_date" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Flight out time</div></td>
     <td><input type="text" name="flight_out_time" value=""></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Requests</div></td>
     <td><textarea name="requests" cols="20" rows="3"></textarea></td>
   </tr>
   <tr class="ver12">
     <td><div align="right">Notes</div></td>
     <td><textarea name="notes" cols="20" rows="3"></textarea></td>
   </tr>
   <tr class="ver12">
     <td><div align="right"></div></td>
     <td><input type="image" name="submit" 
src="images/continue.gif"></td>
   </tr>
</table>
</form>
<p>&nbsp;</p>
</body>
</html>

Thanks,
Jane



More information about the FX.php_List mailing list