Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

postcode insert into DB at creating new customer!!


buRza

Recommended Posts

Hi Peoples iam need some help!!!!

 

ive installed the german shipping Contributions "Eigenlieferung" witch based at 99% on the "Contribution Shipping Zone Rates with SQL" von Lloyd Swadling

 

 

These Contribution create a table called "toll_zones" , the table increased all postcodes they was allowed to use in this Contribution.

 

my idea is, when a new cutomers was creating, the postcode witch was enter in the postcode/zip code field was insert into the toll_zones table

 

INSERT INTO toll_zones VALUES ('XXXXX', 'TOUR', '3.00');

 

 

my proposition: (but it doesnt work :( )

 

    if ((int)$HTTP_POST_VARS['postcode'] == $sql_data_array['postcode'])
 {
    
 }
 else
 {

 if ((int)$HTTP_POST_VARS['postcode'] != $sql_data_array['postcode'])
 {
    tep_db_query("INSERT INTO toll_zones VALUES ('".(int)$HTTP_POST_VARS['postcode']."', 'TOUR', '3.00')");
 }
    elseif((int)$HTTP_POST_VARS['postcode'] != '0')
   {
      tep_db_query("INSERT INTO toll_zones VALUES ('".(int)$HTTP_POST_VARS['postcode']."', 'TOUR', '3.00')");
   }
  
 }

 

 

OR

 

 

    $postcode_query = tep_db_query("select t_postcode from toll_zones");
     $insert_postcode = tep_db_fetch_array($postcode_query);
  
  
    if ((int)$HTTP_POST_VARS['postcode'] != $insert_postcode['t_postcode'])
 {
    tep_db_query("INSERT INTO toll_zones VALUES ('".$HTTP_POST_VARS['postcode']."', 'TOUR', '3.00')");
 }
    elseif((int)$HTTP_POST_VARS['postcode'] != '0')
   {
      tep_db_query("INSERT INTO toll_zones VALUES ('".$HTTP_POST_VARS['postcode']."', 'TOUR', '3.00')");
   }

 

 

What is my false?Can anybody HELP ME??!!! it is very important

 

sorry for my sucking english :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...