Quote:
Originally Posted by Getcarter
Hi guys,
I have a user list of about 400 dealers and would like to import them into the databse...
any ideas how i can do this?
if anyone can help will be great, i'm using phpMyadmin to manage the db.
thanks!
|
The table in x-cart is xcart_customers.
The hard part will be putting the password into the table so that it will work - is it an existing x-cart dealer list?
If so, if you export the data from the existing table using phpmyadmin and then simply import the sql into the new table.
If it isn't.... a lot of work is needed to encrypt the password that you have in a flat file to get them into the database.
The function in xcarts func.php script is:
Code:
function text_crypt($s) {
global $START_CHAR_CODE, $CRYPT_SALT;
if ($s == "")
return $s;
$enc = rand(1,255); # generate random salt.
$result = text_crypt_symbol($enc); # include salt in the result;
$enc ^= $CRYPT_SALT;
for ($i = 0; $i < strlen($s); $i++) {
$r = ord(substr($s, $i, 1)) ^ $enc++;
if ($enc > 255)
$enc = 0;
$result .= text_crypt_symbol($r);
}
return $result;
}
Now in theory it should be possible to run each name in your list through this function and then add it to the table.
Enjoy !!
Funkydunk