[FX.php List] entering data to server
David Tinoco
davet15 at hotmail.com
Wed Jul 19 13:24:34 MDT 2006
I would appreciate it if anyone could look at this code.
Basically, this code checks the database after an order was placed to see if that customer is in the customers table. If not, then a new entry is made. The primary key is the email address, which is why I added the .' " '. at the front and end of $femail, or else filemaker does a search with the @ sign using filemaker search logic. The problem is that it is creating the customer record regardless of whether it's there or not.
Thanks!
$searchemail = '"'.$femail.'"';
$addcust1=new FX($serverIP,$webCompanionPort);
$addcust1->SetDBData('Nutrina Catalog.fp7','Customers');
$addcust1->SetDBPassword($webPW,$webUN);
$addcust1->AddDBParam('UserID',$searchemail);
$addcust1Result=$addcust1->FMFind();
if($addcust1Result['foundCount']== 0){
$addcust2=new FX($serverIP,$webCompanionPort);
$addcust2->SetDBData('Nutrina Catalog.fp7','Customers');
$addcust2->SetDBPassword($webPW,$webUN);
$addcust2->AddDBParam('UserID',$femail);
$addcust2->AddDBParam('First Name',$dfirst);
$addcust2->AddDBParam('Last Name',$dlast);
$addcust2->AddDBParam('Address',$faddress);
$addcust2->AddDBParam('City',$fcity);
$addcust2->AddDBParam('State',$fstate);
$addcust2->AddDBParam('Zip',$fzip);
$addcust2->AddDBParam('Phone',$fphone);
$addcust2Result=$addcust2->FMNew();
}
_________________________________________________________________
Express yourself: design your homepage the way you want it with Live.com.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060719/17d610b5/attachment.html
More information about the FX.php_List
mailing list