RE: Create account with two databases

Sammy1001 <[email protected]>
Newsgroups gmane.comp.web.oscommerce.devel
Message-ID <1701837951f7f2d79dba2a5847216b45@osCommerce-Forums>
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=163859#163859
----------------------------------------------------------------

Hi,

can´t get this working, everything goes ok to both databases to table customers but there goes nothing to table customers_info in another database, any ideas what I did wrong ?

Here is modified code in create_account_process:


[quote]
tep_db_connect('database_server_name', 'database_user_name', 'user_password', 'database_name') or die('Unable to connect to database server!');

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

tep_db_connect() or die('Unable to connect to database server!');

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

$customer_id = tep_db_insert_id();
[/quote]

and here couple rows later:

[quote]
tep_db_connect('database_server_name', 'database_user_name', 'user_password', 'database_name') or die('Unable to connect to database server!');

    tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

    tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . tep_db_input($customer_id) . "', '0', now())");

tep_db_connect() or die('Unable to connect to database server!');
    
    tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

    tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . tep_db_input($customer_id) . "', '0', now())");

[/quote]

I changed these "database_server_name" and so on...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.