[FX.php List] entering data to server

Bob Patin bob at patin.com
Wed Jul 19 16:32:01 MDT 2006


David,

Try changing the 5th line to this:

$addcust1->AddDBParam('UserID',"==".$searchemail);

That will make sure that the search finds the email address, and  
doesn't treat the @ sign as a wildcard.

Best,

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060



>> 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 instantly with Windows Live Messenger
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list